Implemented project-wide localization plumbing and converted the visible UI/app messages to translation-ready strings.

This commit is contained in:
2026-05-18 00:16:37 +03:30
parent b49b59a056
commit c6606d9602
60 changed files with 1376 additions and 345 deletions

View File

@@ -8,6 +8,7 @@ import {
CardHeader,
CardTitle,
} from '@/components/ui/card';
import { useTranslation } from '@/lib/translations';
import { home } from '@/routes';
export default function AuthCardLayout({
@@ -19,6 +20,8 @@ export default function AuthCardLayout({
title?: string;
description?: string;
}>) {
const { t } = useTranslation();
return (
<div className="flex min-h-svh flex-col items-center justify-center gap-6 bg-background p-6 md:p-10">
<div className="flex w-full max-w-md flex-col gap-6">
@@ -34,8 +37,12 @@ export default function AuthCardLayout({
<div className="flex flex-col gap-6">
<Card className="rounded-md shadow-sm">
<CardHeader className="px-10 pt-8 pb-0 text-center">
<CardTitle className="text-xl">{title}</CardTitle>
<CardDescription>{description}</CardDescription>
<CardTitle className="text-xl">
{t(title ?? '')}
</CardTitle>
<CardDescription>
{t(description ?? '')}
</CardDescription>
</CardHeader>
<CardContent className="px-10 py-8">
{children}

View File

@@ -1,5 +1,6 @@
import { Link } from '@inertiajs/react';
import AppLogoIcon from '@/components/app-logo-icon';
import { useTranslation } from '@/lib/translations';
import { home } from '@/routes';
import type { AuthLayoutProps } from '@/types';
@@ -8,6 +9,8 @@ export default function AuthSimpleLayout({
title,
description,
}: AuthLayoutProps) {
const { t } = useTranslation();
return (
<div className="flex min-h-svh flex-col items-center justify-center gap-6 bg-background p-6 md:p-10">
<div className="w-full max-w-sm rounded-md border bg-card p-6 shadow-sm">
@@ -20,13 +23,15 @@ export default function AuthSimpleLayout({
<div className="mb-1 flex size-10 items-center justify-center rounded-md bg-primary text-primary-foreground">
<AppLogoIcon className="size-6 fill-current" />
</div>
<span className="sr-only">{title}</span>
<span className="sr-only">{t(title ?? '')}</span>
</Link>
<div className="space-y-2 text-center">
<h1 className="text-xl font-semibold">{title}</h1>
<h1 className="text-xl font-semibold">
{t(title ?? '')}
</h1>
<p className="text-center text-sm text-muted-foreground">
{description}
{t(description ?? '')}
</p>
</div>
</div>

View File

@@ -1,5 +1,6 @@
import { Link, usePage } from '@inertiajs/react';
import AppLogoIcon from '@/components/app-logo-icon';
import { useTranslation } from '@/lib/translations';
import { home } from '@/routes';
import type { AuthLayoutProps } from '@/types';
@@ -9,6 +10,7 @@ export default function AuthSplitLayout({
description,
}: AuthLayoutProps) {
const { name } = usePage().props;
const { t } = useTranslation();
return (
<div className="relative grid h-dvh flex-col items-center justify-center px-8 sm:px-0 lg:max-w-none lg:grid-cols-2 lg:px-0">
@@ -31,9 +33,11 @@ export default function AuthSplitLayout({
<AppLogoIcon className="h-10 fill-current text-black sm:h-12" />
</Link>
<div className="flex flex-col items-start gap-2 text-left sm:items-center sm:text-center">
<h1 className="text-xl font-medium">{title}</h1>
<h1 className="text-xl font-medium">
{t(title ?? '')}
</h1>
<p className="text-sm text-balance text-muted-foreground">
{description}
{t(description ?? '')}
</p>
</div>
{children}