mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 12:14:19 +00:00
Merge pull request #1249 from kaitranntt/kai/feat/1241-korean-i18n
feat(dashboard): add Korean language support (#1241)
This commit is contained in:
3 files changed
+2763
-1
No files matched your search
+2760
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
||||
export const LOCALE_STORAGE_KEY = 'ccs-ui-locale';
|
||||
|
||||
export const SUPPORTED_LOCALES = ['en', 'zh-CN', 'vi', 'ja'] as const;
|
||||
export const SUPPORTED_LOCALES = ['en', 'zh-CN', 'vi', 'ja', 'ko'] as const;
|
||||
|
||||
export type AppLocale = (typeof SUPPORTED_LOCALES)[number];
|
||||
|
||||
@@ -10,6 +10,7 @@ export function isSupportedLocale(locale: string): locale is AppLocale {
|
||||
|
||||
export function normalizeLocale(locale: string | null | undefined): AppLocale {
|
||||
if (!locale) return 'en';
|
||||
if (locale.toLowerCase().startsWith('ko')) return 'ko';
|
||||
if (locale.toLowerCase().startsWith('ja')) return 'ja';
|
||||
if (locale.toLowerCase().startsWith('zh')) return 'zh-CN';
|
||||
if (locale.toLowerCase().startsWith('vi')) return 'vi';
|
||||
|
||||
@@ -96,6 +96,7 @@ describe('Dashboard i18n', () => {
|
||||
it.each([
|
||||
{ locale: 'vi', label: 'Vietnamese', browserLocale: 'vi-VN' },
|
||||
{ locale: 'ja', label: 'Japanese', browserLocale: 'ja-JP' },
|
||||
{ locale: 'ko', label: 'Korean', browserLocale: 'ko-KR' },
|
||||
])(
|
||||
'supports $locale locale in switcher and persistence',
|
||||
async ({ locale, label, browserLocale }) => {
|
||||
|
||||
Reference in new issue
Block a user