]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/i18n/i18n.ts
Fix zh locales
[github/Chocobozzz/PeerTube.git] / shared / models / i18n / i18n.ts
index baf3fa0f482c5ae0b398d5f49fe7510221aeb138..03a5d858af495be5f864839ec7795f05e182c93f 100644 (file)
@@ -3,14 +3,26 @@ export const LOCALE_FILES = [ 'player', 'server' ]
 export const I18N_LOCALES = {
   'en-US': 'English',
   'fr-FR': 'Français',
-  'eu-ES': 'euskara',
-  'ca-ES': 'català',
-  'cs-CZ': 'čeština',
+  'ja-JP': '日本語',
+  'eu-ES': 'Euskara',
+  'ca-ES': 'Català',
+  'cs-CZ': 'Čeština',
   'eo': 'Esperanto',
+  'el-GR': 'ελληνικά',
   'de-DE': 'Deutsch',
-  'es-ES': 'español',
-  'zh-Hant-TW': '中文 (繁體, 台灣)'
-  // 'pl-PL': 'polski'
+  'it-IT': 'Italiano',
+  'nl-NL': 'Nederlands',
+  'es-ES': 'Español',
+  'oc': 'Occitan',
+  'gd': 'Gàidhlig',
+  'zh-Hant-TW': '繁體中文(台灣)',
+  'pt-BR': 'Português (Brasil)',
+  'pt-PT': 'Português (Portugal)',
+  'sv-SE': 'svenska',
+  'pl-PL': 'Polski',
+  'fi-FI': 'suomi',
+  'ru-RU': 'русский',
+  'zh-Hans-CN': '简体中文(中国)'
 }
 
 const I18N_LOCALE_ALIAS = {
@@ -20,8 +32,16 @@ const I18N_LOCALE_ALIAS = {
   'ca': 'ca-ES',
   'cs': 'cs-CZ',
   'de': 'de-DE',
-  'es': 'es-ES'
-  // 'pl': 'pl-PL'
+  'es': 'es-ES',
+  'pt': 'pt-PT',
+  'fi': 'fi-FI',
+  'sv': 'sv-SE',
+  'pl': 'pl-PL',
+  'ru': 'ru-RU',
+  'nl': 'nl-NL',
+  'zh': 'zh-Hans-CN',
+  'zh-CN': 'zh-Hans-CN',
+  'zh-TW': 'zh-Hant-TW'
 }
 
 export const POSSIBLE_LOCALES = Object.keys(I18N_LOCALES)
@@ -35,6 +55,10 @@ export function isDefaultLocale (locale: string) {
   return getCompleteLocale(locale) === getCompleteLocale(getDefaultLocale())
 }
 
+export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) {
+  return translations && translations[str] ? translations[str] : str
+}
+
 const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l)
 export function is18nPath (path: string) {
   return possiblePaths.indexOf(path) !== -1