0
Fork 0
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:
IceHe.xyz 2022-04-21 10:55:06 +08:00 committed by GitHub
parent 3db582aee3
commit 7990b813ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 15 deletions

View file

@ -1,7 +1,7 @@
import { Language } from '@logto/phrases';
import {
Branding,
BrandingStyle,
Language,
LanguageInfo,
SignInExperience,
SignInMethods,

View file

@ -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,

View file

@ -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;

View file

@ -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),

View file

@ -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',