2022-01-24 17:26:08 +08:00
|
|
|
import { NormalizeKeyPaths } from '@silverhand/essentials';
|
|
|
|
|
2021-07-28 01:13:51 +08:00
|
|
|
import en from './locales/en';
|
2022-08-14 14:36:10 +02:00
|
|
|
import fr from './locales/fr';
|
2022-07-30 23:48:50 +09:00
|
|
|
import koKR from './locales/ko-kr';
|
2022-07-30 16:48:45 +03:00
|
|
|
import trTR from './locales/tr-tr';
|
2021-07-28 01:13:51 +08:00
|
|
|
import zhCN from './locales/zh-cn';
|
2022-05-12 12:17:17 +08:00
|
|
|
import { Resource, Language } from './types';
|
2021-07-28 01:13:51 +08:00
|
|
|
|
2022-07-25 18:15:59 +08:00
|
|
|
export { Language, languageOptions, languageEnumGuard } from './types';
|
2022-07-15 17:03:07 +08:00
|
|
|
export type Translation = typeof en.translation;
|
|
|
|
export type Errors = typeof en.errors;
|
|
|
|
export type LogtoErrorCode = NormalizeKeyPaths<Errors>;
|
2021-08-14 21:39:37 +08:00
|
|
|
export type LogtoErrorI18nKey = `errors:${LogtoErrorCode}`;
|
2022-07-15 17:03:07 +08:00
|
|
|
export type I18nKey = NormalizeKeyPaths<Translation>;
|
2022-03-04 12:47:02 +08:00
|
|
|
export type AdminConsoleKey = NormalizeKeyPaths<typeof en.translation.admin_console>;
|
2021-07-28 01:13:51 +08:00
|
|
|
|
|
|
|
const resource: Resource = {
|
2022-04-21 10:55:06 +08:00
|
|
|
[Language.English]: en,
|
2022-08-14 14:36:10 +02:00
|
|
|
[Language.French]: fr,
|
2022-04-21 10:55:06 +08:00
|
|
|
[Language.Chinese]: zhCN,
|
2022-07-30 23:48:50 +09:00
|
|
|
[Language.Korean]: koKR,
|
2022-07-30 16:48:45 +03:00
|
|
|
[Language.Turkish]: trTR,
|
2021-07-28 01:13:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
export default resource;
|