feat: add Polish localization (#1123)
* Add Polish (pl) localization * translations * fix: add missing Polish translations * copy en keys to pl * fix: complete Polish settings translations * fix: localize PWA install prompt * fix pwa install prompt lifecycle and complete Polish locale keys * polish polish locale wording for natural phrasing --------- Co-authored-by: levy52 <levy52@vp.pl> Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
levy52
Bohdan Triapitsyn
parent
ce4c5ae99f
commit
7eff2f725f
@@ -1,16 +1,17 @@
|
||||
export type Locale = 'en' | 'zh-CN' | 'uk' | 'es' | 'pt-BR' | 'ko';
|
||||
export type Locale = 'en' | 'zh-CN' | 'uk' | 'es' | 'pt-BR' | 'ko' | 'pl';
|
||||
|
||||
export const LOCALES = ['en', 'zh-CN', 'uk', 'es', 'pt-BR', 'ko'] as const satisfies readonly Locale[];
|
||||
export const LOCALES = ['en', 'zh-CN', 'uk', 'es', 'pt-BR', 'ko', 'pl'] 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' | 'common.language.korean'> = {
|
||||
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' | 'common.language.polish'> = {
|
||||
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',
|
||||
pl: 'common.language.polish',
|
||||
};
|
||||
|
||||
export const LOCALE_STORAGE_KEY = 'openchamber.i18n.v1';
|
||||
@@ -46,6 +47,9 @@ export function normalizeLocale(value: string | undefined | null): Locale {
|
||||
if (normalized === 'ko' || normalized.startsWith('ko-')) {
|
||||
return 'ko';
|
||||
}
|
||||
if (normalized === 'pl' || normalized.startsWith('pl-')) {
|
||||
return 'pl';
|
||||
}
|
||||
return DEFAULT_LOCALE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user