diff options
Diffstat (limited to 'shared/models/i18n')
-rw-r--r-- | shared/models/i18n/i18n.ts | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.ts index 032944281..36688382d 100644 --- a/shared/models/i18n/i18n.ts +++ b/shared/models/i18n/i18n.ts | |||
@@ -1,44 +1,50 @@ | |||
1 | export const LOCALE_FILES = [ 'player', 'server' ] | 1 | export const LOCALE_FILES = [ 'player', 'server' ] |
2 | 2 | ||
3 | export const I18N_LOCALES = { | 3 | export const I18N_LOCALES = { |
4 | // Always first to avoid issues when using express acceptLanguages function when no accept language header is set | ||
4 | 'en-US': 'English', | 5 | 'en-US': 'English', |
5 | 'fr-FR': 'Français', | 6 | |
6 | 'ja-JP': '日本語', | ||
7 | 'eu-ES': 'Euskara', | ||
8 | 'ca-ES': 'Català', | 7 | 'ca-ES': 'Català', |
9 | 'cs-CZ': 'Čeština', | 8 | 'cs-CZ': 'Čeština', |
10 | 'eo': 'Esperanto', | ||
11 | 'el-GR': 'ελληνικά', | ||
12 | 'de-DE': 'Deutsch', | 9 | 'de-DE': 'Deutsch', |
10 | 'el-GR': 'ελληνικά', | ||
11 | 'eo': 'Esperanto', | ||
12 | 'es-ES': 'Español', | ||
13 | 'eu-ES': 'Euskara', | ||
14 | 'fi-FI': 'suomi', | ||
15 | 'fr-FR': 'Français', | ||
16 | 'gd': 'Gàidhlig', | ||
17 | 'hu-HU': 'magyar', | ||
13 | 'it-IT': 'Italiano', | 18 | 'it-IT': 'Italiano', |
19 | 'ja-JP': '日本語', | ||
14 | 'nl-NL': 'Nederlands', | 20 | 'nl-NL': 'Nederlands', |
15 | 'es-ES': 'Español', | ||
16 | 'oc': 'Occitan', | 21 | 'oc': 'Occitan', |
17 | 'gd': 'Gàidhlig', | 22 | 'pl-PL': 'Polski', |
18 | 'zh-Hant-TW': '繁體中文(台灣)', | ||
19 | 'pt-BR': 'Português (Brasil)', | 23 | 'pt-BR': 'Português (Brasil)', |
20 | 'pt-PT': 'Português (Portugal)', | 24 | 'pt-PT': 'Português (Portugal)', |
21 | 'sv-SE': 'svenska', | ||
22 | 'pl-PL': 'Polski', | ||
23 | 'fi-FI': 'suomi', | ||
24 | 'ru-RU': 'русский', | 25 | 'ru-RU': 'русский', |
25 | 'zh-Hans-CN': '简体中文(中国)' | 26 | 'sv-SE': 'svenska', |
27 | 'th-TH': 'ไทย', | ||
28 | 'zh-Hans-CN': '简体中文(中国)', | ||
29 | 'zh-Hant-TW': '繁體中文(台灣)' | ||
26 | } | 30 | } |
27 | 31 | ||
28 | const I18N_LOCALE_ALIAS = { | 32 | const I18N_LOCALE_ALIAS = { |
29 | 'en': 'en-US', | ||
30 | 'fr': 'fr-FR', | ||
31 | 'eu': 'eu-ES', | ||
32 | 'ca': 'ca-ES', | 33 | 'ca': 'ca-ES', |
33 | 'cs': 'cs-CZ', | 34 | 'cs': 'cs-CZ', |
34 | 'de': 'de-DE', | 35 | 'de': 'de-DE', |
36 | 'en': 'en-US', | ||
35 | 'es': 'es-ES', | 37 | 'es': 'es-ES', |
36 | 'pt': 'pt-PT', | 38 | 'eu': 'eu-ES', |
37 | 'fi': 'fi-FI', | 39 | 'fi': 'fi-FI', |
38 | 'sv': 'sv-SE', | 40 | 'fr': 'fr-FR', |
41 | 'hu': 'hu-HU', | ||
42 | 'nl': 'nl-NL', | ||
39 | 'pl': 'pl-PL', | 43 | 'pl': 'pl-PL', |
44 | 'pt': 'pt-PT', | ||
40 | 'ru': 'ru-RU', | 45 | 'ru': 'ru-RU', |
41 | 'nl': 'nl-NL', | 46 | 'sv': 'sv-SE', |
47 | 'th': 'th-TH', | ||
42 | 'zh': 'zh-Hans-CN', | 48 | 'zh': 'zh-Hans-CN', |
43 | 'zh-CN': 'zh-Hans-CN', | 49 | 'zh-CN': 'zh-Hans-CN', |
44 | 'zh-TW': 'zh-Hant-TW' | 50 | 'zh-TW': 'zh-Hant-TW' |
@@ -56,6 +62,8 @@ export function isDefaultLocale (locale: string) { | |||
56 | } | 62 | } |
57 | 63 | ||
58 | export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) { | 64 | export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) { |
65 | // FIXME: remove disable rule when the client is upgraded to typescript 3.7 | ||
66 | // eslint-disable-next-line | ||
59 | return translations && translations[str] ? translations[str] : str | 67 | return translations && translations[str] ? translations[str] : str |
60 | } | 68 | } |
61 | 69 | ||