i18n: add language aliasing
This commit is contained in:
1 parent
1804d9efee
commit
4b42e40817
5 files changed
+71
-26
No files matched your search
+1
-12
@@ -629,19 +629,8 @@
|
||||
"lang": {
|
||||
"title": "Language",
|
||||
"description": "The language used for Photon's UI.",
|
||||
"note": "Languages other than English and Hebrew are community translated, and may be incomplete.",
|
||||
"en": "English",
|
||||
"en-US": "English",
|
||||
"he": "Hebrew",
|
||||
"et": "Estonian",
|
||||
"fr": "French",
|
||||
"de": "German",
|
||||
"fi": "Finnish",
|
||||
"pt": "Portuguese",
|
||||
"zh": "Chinese",
|
||||
"zh-Hans": "Chinese (Simplified)",
|
||||
"zh-Hant": "Chinese (Traditional)",
|
||||
"auto": "Auto",
|
||||
"community": "Community",
|
||||
"credits": "Credits",
|
||||
"useRtl": {
|
||||
"title": "Use RTL layout",
|
||||
|
||||
@@ -51,6 +51,26 @@ const config: Config = {
|
||||
fallbackLocale: 'en',
|
||||
}
|
||||
|
||||
export const aliases = new Map([
|
||||
['zh-CN', 'zh-Hans'],
|
||||
['zh-TW', 'zh-Hant'],
|
||||
['en-US', 'en'],
|
||||
['en-GB', 'en'],
|
||||
['en-AU', 'en'],
|
||||
['en-CA', 'en'],
|
||||
['fr-FR', 'fr'],
|
||||
['fr-CA', 'fr'],
|
||||
['fr-BE', 'fr'],
|
||||
['de-DE', 'de'],
|
||||
['de-AT', 'de'],
|
||||
['de-CH', 'de'],
|
||||
['pt-BR', 'pt'],
|
||||
['pt-PT', 'pt'],
|
||||
['fi-FI', 'fi'],
|
||||
['et-EE', 'et'],
|
||||
['he-IL', 'he'],
|
||||
])
|
||||
|
||||
export const { t, locale, locales, loading, loadTranslations } = new i18n(
|
||||
config
|
||||
)
|
||||
Reference in new issue
Block a user