implement localization
This commit is contained in:
3
resources/js/types/global.d.ts
vendored
3
resources/js/types/global.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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[];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user