implement localization

This commit is contained in:
2026-05-18 05:47:02 +03:30
parent e4ee983393
commit 774e2043c2
45 changed files with 704 additions and 140 deletions

View File

@@ -1,5 +1,5 @@
import type { Auth } from '@/types/auth';
import type { Translations } from '@/types/localization';
import type { Localization, Translations } from '@/types/localization';
declare module 'react' {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -15,6 +15,7 @@ declare module '@inertiajs/core' {
auth: Auth;
fallbackLocale: string;
locale: string;
localization: Localization;
sidebarOpen: boolean;
translations: Translations;
[key: string]: unknown;

View File

@@ -4,3 +4,20 @@ export type TranslationReplacements = Record<
string,
boolean | null | number | string | undefined
>;
export type LocaleDirection = 'ltr' | 'rtl';
export type LocaleOption = {
code: string;
name: string;
nativeName: string;
direction: LocaleDirection;
};
export type Localization = {
locale: string;
fallbackLocale: string;
direction: LocaleDirection;
isRtl: boolean;
locales: LocaleOption[];
};