]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/i18n/i18n.ts
better documentation
[github/Chocobozzz/PeerTube.git] / shared / models / i18n / i18n.ts
index a123fdd63bca6c53bc88f0c6a2098ed0b0540b6b..5c3249452e1a20b7ba0ca8ff163c33a4d456f191 100644 (file)
@@ -3,15 +3,18 @@ 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': 'Ä\8deština',
+  'eu-ES': 'Euskara',
+  'ca-ES': 'Català',
+  'cs-CZ': 'Ä\8ceština',
   'eo': 'Esperanto',
   'de-DE': 'Deutsch',
-  'es-ES': 'español',
-  'oc': 'occitan',
-  'zh-Hant-TW': '中文 (繁體, 台灣)'
-  // 'pl-PL': 'polski'
+  'es-ES': 'Español',
+  'oc': 'Occitan',
+  'zh-Hant-TW': '繁體中文(台灣)',
+  'pt-BR': 'Português (Brasil)',
+  'sv-SE': 'svenska',
+  // 'pl-PL': 'Polski'
+  'zh-Hans-CN': '简体中文(中国)'
 }
 
 const I18N_LOCALE_ALIAS = {
@@ -21,7 +24,9 @@ const I18N_LOCALE_ALIAS = {
   'ca': 'ca-ES',
   'cs': 'cs-CZ',
   'de': 'de-DE',
-  'es': 'es-ES'
+  'es': 'es-ES',
+  'pt': 'pt-BR',
+  'sv': 'sv-SE'
   // 'pl': 'pl-PL'
 }
 
@@ -36,6 +41,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