Skip to content

Commit

Permalink
fix: fix #2379
Browse files Browse the repository at this point in the history
  • Loading branch information
lizheming committed Jun 26, 2024
1 parent da74b61 commit 48a9c9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/client/src/config/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export const DEFAULT_LOCALES: Locales = {
};

export const getLocale = (lang: string): WalineLocale =>
DEFAULT_LOCALES[lang.toLowerCase()] || DEFAULT_LOCALES[DEFAULT_LANG];
DEFAULT_LOCALES[lang.toLowerCase()] ||
DEFAULT_LOCALES[DEFAULT_LANG.toLowerCase()];

export const getLang = (lang: string): string =>
Object.keys(DEFAULT_LOCALES).includes(lang.toLowerCase())
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const getConfig = ({
path: decodePath(path),
lang: getLang(lang),
locale: {
...getLocale(lang),
...getLocale(getLang(lang)),
...(typeof locale === 'object' ? locale : {}),
} as WalineLocale,
wordLimit: getWordLimit(wordLimit),
Expand Down

0 comments on commit 48a9c9c

Please sign in to comment.