Fix peertube interface i18n

pull/2315/head
Chocobozzz 2020-04-03 14:55:16 +02:00
parent a7d3671dc3
commit 1fe654e096
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 8 additions and 3 deletions

View File

@ -81,12 +81,12 @@ export function metaFactory (serverService: ServerService): MetaLoader {
{ {
provide: TRANSLATIONS, provide: TRANSLATIONS,
useFactory: (locale: string) => { useFactory: (locale: string) => {
// Default locale, nothing to translate // Default locale, nothing to translate
const completeLocale = getCompleteLocale(locale) const completeLocale = getCompleteLocale(locale)
if (isDefaultLocale(completeLocale)) return '' if (isDefaultLocale(completeLocale)) return ''
const fileLocale = buildFileLocale(locale) const fileLocale = buildFileLocale(locale)
return require(`raw-loader!../locale/angular.${fileLocale}.xlf`) return require(`raw-loader!../locale/angular.${fileLocale}.xlf`).default
}, },
deps: [ LOCALE_ID ] deps: [ LOCALE_ID ]
}, },

View File

@ -33,20 +33,25 @@ const I18N_LOCALE_ALIAS = {
'ca': 'ca-ES', 'ca': 'ca-ES',
'cs': 'cs-CZ', 'cs': 'cs-CZ',
'de': 'de-DE', 'de': 'de-DE',
'el': 'el-GR',
'en': 'en-US', 'en': 'en-US',
'es': 'es-ES', 'es': 'es-ES',
'eu': 'eu-ES', 'eu': 'eu-ES',
'fi': 'fi-FI', 'fi': 'fi-FI',
'fr': 'fr-FR', 'fr': 'fr-FR',
'ja': 'ja-JP',
'it': 'it-IT',
'hu': 'hu-HU', 'hu': 'hu-HU',
'nl': 'nl-NL', 'nl': 'nl-NL',
'pl': 'pl-PL', 'pl': 'pl-PL',
'pt': 'pt-PT', 'pt': 'pt-BR',
'ru': 'ru-RU', 'ru': 'ru-RU',
'sv': 'sv-SE', 'sv': 'sv-SE',
'th': 'th-TH', 'th': 'th-TH',
'zh': 'zh-Hans-CN', 'zh': 'zh-Hans-CN',
'zh-Hans': 'zh-Hans-CN',
'zh-CN': 'zh-Hans-CN', 'zh-CN': 'zh-Hans-CN',
'zh-Hant': 'zh-Hant-TW',
'zh-TW': 'zh-Hant-TW' 'zh-TW': 'zh-Hant-TW'
} }