feat: add Korean locale (#1040)
This commit is contained in:
@@ -7,6 +7,7 @@ export const dict = {
|
||||
'common.language.ukrainian': 'Ukrainian',
|
||||
'common.language.spanish': 'Spanish',
|
||||
'common.language.brazilianPortuguese': 'Brazilian Portuguese',
|
||||
'common.language.korean': 'Korean',
|
||||
'common.revealPath.finder': 'Reveal in Finder',
|
||||
'common.revealPath.fileExplorer': 'Open in File Explorer',
|
||||
'common.revealPath.fileManager': 'Open in File Manager',
|
||||
|
||||
@@ -8,6 +8,7 @@ export const dict: Record<I18nKey, string> = {
|
||||
"common.language.ukrainian": "Ucraniano",
|
||||
"common.language.spanish": "Español",
|
||||
"common.language.brazilianPortuguese": "Portugués brasileño",
|
||||
"common.language.korean": "Coreano",
|
||||
"common.revealPath.finder": "Mostrar en Finder",
|
||||
"common.revealPath.fileExplorer": "Abrir en File Explorer",
|
||||
"common.revealPath.fileManager": "Abrir en gestor de archivos",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,7 @@ export const dict: Record<I18nKey, string> = {
|
||||
"common.language.ukrainian": "Ucraniano",
|
||||
"common.language.spanish": "Espanhol",
|
||||
"common.language.brazilianPortuguese": "Português brasileiro",
|
||||
"common.language.korean": "Coreano",
|
||||
"common.revealPath.finder": "Mostrar no Finder",
|
||||
"common.revealPath.fileExplorer": "Abrir no File Explorer",
|
||||
"common.revealPath.fileManager": "Abrir no gerenciador de arquivos",
|
||||
|
||||
@@ -8,6 +8,7 @@ export const dict: Record<I18nKey, string> = {
|
||||
"common.language.ukrainian": "Українська",
|
||||
"common.language.spanish": "Іспанська",
|
||||
"common.language.brazilianPortuguese": "Бразильська португальська",
|
||||
"common.language.korean": "Корейська",
|
||||
"common.revealPath.finder": "Показати у Finder",
|
||||
"common.revealPath.fileExplorer": "Відкрити у File Explorer",
|
||||
"common.revealPath.fileManager": "Відкрити у файловому менеджері",
|
||||
|
||||
@@ -8,6 +8,7 @@ export const dict: Record<I18nKey, string> = {
|
||||
'common.language.ukrainian': '乌克兰语',
|
||||
'common.language.spanish': '西班牙语',
|
||||
'common.language.brazilianPortuguese': '巴西葡萄牙语',
|
||||
'common.language.korean': '韩语',
|
||||
'common.revealPath.finder': '在 Finder 中显示',
|
||||
'common.revealPath.fileExplorer': '在文件资源管理器中打开',
|
||||
'common.revealPath.fileManager': '在文件管理器中打开',
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
export type Locale = 'en' | 'zh-CN' | 'uk' | 'es' | 'pt-BR';
|
||||
export type Locale = 'en' | 'zh-CN' | 'uk' | 'es' | 'pt-BR' | 'ko';
|
||||
|
||||
export const LOCALES = ['en', 'zh-CN', 'uk', 'es', 'pt-BR'] as const satisfies readonly Locale[];
|
||||
export const LOCALES = ['en', 'zh-CN', 'uk', 'es', 'pt-BR', 'ko'] as const satisfies readonly Locale[];
|
||||
|
||||
export const DEFAULT_LOCALE: Locale = 'en';
|
||||
|
||||
export const LOCALE_LABEL_KEYS: Record<Locale, 'common.language.english' | 'common.language.simplifiedChinese' | 'common.language.ukrainian' | 'common.language.spanish' | 'common.language.brazilianPortuguese'> = {
|
||||
export const LOCALE_LABEL_KEYS: Record<Locale, 'common.language.english' | 'common.language.simplifiedChinese' | 'common.language.ukrainian' | 'common.language.spanish' | 'common.language.brazilianPortuguese' | 'common.language.korean'> = {
|
||||
en: 'common.language.english',
|
||||
'zh-CN': 'common.language.simplifiedChinese',
|
||||
uk: 'common.language.ukrainian',
|
||||
es: 'common.language.spanish',
|
||||
'pt-BR': 'common.language.brazilianPortuguese',
|
||||
ko: 'common.language.korean',
|
||||
};
|
||||
|
||||
export const LOCALE_STORAGE_KEY = 'openchamber.i18n.v1';
|
||||
@@ -42,6 +43,9 @@ export function normalizeLocale(value: string | undefined | null): Locale {
|
||||
if (normalized === 'pt' || normalized === 'pt-br' || normalized.startsWith('pt-br-')) {
|
||||
return 'pt-BR';
|
||||
}
|
||||
if (normalized === 'ko' || normalized.startsWith('ko-')) {
|
||||
return 'ko';
|
||||
}
|
||||
return DEFAULT_LOCALE;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ async function loadDictionary(locale: Locale): Promise<I18nDictionary> {
|
||||
? await import('./messages/pt-BR') as { dict: I18nDictionary }
|
||||
: locale === 'uk'
|
||||
? await import('./messages/uk') as { dict: I18nDictionary }
|
||||
: locale === 'ko'
|
||||
? await import('./messages/ko') as { dict: I18nDictionary }
|
||||
: { dict: enDict };
|
||||
dictionaries.set(locale, mod.dict);
|
||||
return mod.dict;
|
||||
|
||||
Reference in New Issue
Block a user