add: internationalization translation to danish

This commit is contained in:
2025-11-25 21:59:53 +01:00
parent 0c8dc087ca
commit 3b7b54b4bf
14 changed files with 311 additions and 227 deletions

View File

@@ -4,11 +4,15 @@
import { Input } from '$lib/components/ui/input';
import { Label } from '$lib/components/ui/label';
import { ThemeToggle } from '$lib/components/ui/theme-toggle';
import { LanguageToggle } from '$lib/components/ui/language-toggle';
import type { PageData } from './$types';
import { signIn } from '@auth/sveltekit/client';
import { languageStore } from '$lib/stores/language.svelte';
let { data }: { data: PageData } = $props();
const t = $derived(languageStore.t);
let isSubmitting = $state(false);
async function handleSubmit(e: SubmitEvent) {
@@ -34,13 +38,14 @@
</script>
<div class="min-h-screen flex items-center justify-center p-4">
<div class="absolute top-4 right-4">
<div class="absolute top-4 right-4 flex items-center gap-1 sm:gap-2">
<LanguageToggle />
<ThemeToggle />
</div>
<Card class="w-full max-w-md">
<CardHeader>
<CardTitle class="text-2xl">Welcome Back</CardTitle>
<CardDescription>Sign in to your account</CardDescription>
<CardTitle class="text-2xl">{t.auth.welcomeBack}</CardTitle>
<CardDescription>{t.auth.signInPrompt}</CardDescription>
</CardHeader>
<CardContent class="space-y-4">
{#if data.registered}
@@ -57,17 +62,17 @@
<form onsubmit={handleSubmit} class="space-y-4">
<div class="space-y-2">
<Label for="username">Username</Label>
<Label for="username">{t.form.username}</Label>
<Input id="username" name="username" type="text" required />
</div>
<div class="space-y-2">
<Label for="password">Password</Label>
<Label for="password">{t.form.password}</Label>
<Input id="password" name="password" type="password" required />
</div>
<Button type="submit" class="w-full" disabled={isSubmitting}>
{isSubmitting ? 'Signing in...' : 'Sign In'}
{isSubmitting ? t.auth.signingIn : t.auth.signIn}
</Button>
</form>
@@ -77,7 +82,7 @@
<span class="w-full border-t"></span>
</div>
<div class="relative flex justify-center text-xs uppercase">
<span class="bg-card px-2 text-muted-foreground">Or continue with</span>
<span class="bg-card px-2 text-muted-foreground">{t.auth.continueWith}</span>
</div>
</div>
@@ -88,14 +93,14 @@
class="w-full"
onclick={() => signIn(provider.id, { callbackUrl: '/dashboard' })}
>
Sign in with {provider.name}
{t.auth.signIn} with {provider.name}
</Button>
{/each}
{/if}
<div class="text-center text-sm text-muted-foreground">
Don't have an account?
<a href="/signup" class="text-primary hover:underline">Sign up</a>
{t.auth.dontHaveAccount}
<a href="/signup" class="text-primary hover:underline">{t.auth.signUp}</a>
</div>
</CardContent>
</Card>