mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor(core,phrases,schemas): move language enum and fix Chinese enum value (#593)
This commit is contained in:
parent
3db582aee3
commit
7990b813ab
5 changed files with 14 additions and 15 deletions
|
@ -1,7 +1,7 @@
|
|||
import { Language } from '@logto/phrases';
|
||||
import {
|
||||
Branding,
|
||||
BrandingStyle,
|
||||
Language,
|
||||
LanguageInfo,
|
||||
SignInExperience,
|
||||
SignInMethods,
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
import {
|
||||
CreateSignInExperience,
|
||||
Language,
|
||||
SignInExperience,
|
||||
SignInMethodState,
|
||||
} from '@logto/schemas';
|
||||
import { Language } from '@logto/phrases';
|
||||
import { CreateSignInExperience, SignInExperience, SignInMethodState } from '@logto/schemas';
|
||||
|
||||
import {
|
||||
mockAliyunDmConnectorInstance,
|
||||
|
|
|
@ -10,9 +10,14 @@ export type Languages = keyof Resource;
|
|||
export type I18nKey = NormalizeKeyPaths<typeof en.translation>;
|
||||
export type AdminConsoleKey = NormalizeKeyPaths<typeof en.translation.admin_console>;
|
||||
|
||||
export enum Language {
|
||||
English = 'en',
|
||||
Chinese = 'zh-CN',
|
||||
}
|
||||
|
||||
const resource: Resource = {
|
||||
en,
|
||||
'zh-CN': zhCN,
|
||||
[Language.English]: en,
|
||||
[Language.Chinese]: zhCN,
|
||||
};
|
||||
|
||||
export default resource;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { Language } from '@logto/phrases';
|
||||
import { z } from 'zod';
|
||||
|
||||
/**
|
||||
|
@ -119,11 +120,6 @@ export const termsOfUseGuard = z.object({
|
|||
|
||||
export type TermsOfUse = z.infer<typeof termsOfUseGuard>;
|
||||
|
||||
export enum Language {
|
||||
English = 'en',
|
||||
Chinese = 'zh-cn',
|
||||
}
|
||||
|
||||
export const languageInfoGuard = z.object({
|
||||
autoDetect: z.boolean(),
|
||||
fallbackLanguage: z.nativeEnum(Language),
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { Language } from '@logto/phrases';
|
||||
|
||||
import { CreateSignInExperience } from '../db-entries';
|
||||
import { BrandingStyle, Language, SignInMethodState } from '../foundations';
|
||||
import { BrandingStyle, SignInMethodState } from '../foundations';
|
||||
|
||||
export const defaultSignInExperience: Readonly<CreateSignInExperience> = {
|
||||
id: 'default',
|
||||
|
|
Loading…
Reference in a new issue