X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fcore-utils%2Fi18n%2Fi18n.ts;h=f0fcb5af7c717363f30baf8747e5f827af0d3f7f;hb=cbf180b978de3c4a2d705d5c2820b95494add512;hp=cc7621da8b0570fc27a37e6d1ac6921c8be321f6;hpb=c7444546e7b9706df40f1bf27563b1a3e29ff71f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/core-utils/i18n/i18n.ts b/shared/core-utils/i18n/i18n.ts index cc7621da8..f0fcb5af7 100644 --- a/shared/core-utils/i18n/i18n.ts +++ b/shared/core-utils/i18n/i18n.ts @@ -17,6 +17,7 @@ export const I18N_LOCALES = { 'gd': 'Gàidhlig', 'gl-ES': 'galego', 'hu-HU': 'magyar', + 'fa-IR': 'فارسی', 'it-IT': 'Italiano', 'ja-JP': '日本語', 'kab': 'Taqbaylit', @@ -26,7 +27,10 @@ export const I18N_LOCALES = { 'pt-BR': 'Português (Brasil)', 'pt-PT': 'Português (Portugal)', 'ru-RU': 'русский', - 'sv-SE': 'svenska', + 'sq': 'Shqip', + 'sv-SE': 'Svenska', + 'nn': 'norsk nynorsk', + 'nb-NO': 'norsk bokmål', 'th-TH': 'ไทย', 'vi-VN': 'Tiếng Việt', 'zh-Hans-CN': '简体中文(中国)', @@ -44,6 +48,7 @@ const I18N_LOCALE_ALIAS = { 'eu': 'eu-ES', 'fi': 'fi-FI', 'gl': 'gl-ES', + 'fa': 'fa-IR', 'fr': 'fr-FR', 'hu': 'hu-HU', 'it': 'it-IT', @@ -51,6 +56,7 @@ const I18N_LOCALE_ALIAS = { 'nl': 'nl-NL', 'pl': 'pl-PL', 'pt': 'pt-BR', + 'nb': 'nb-NO', 'ru': 'ru-RU', 'sv': 'sv-SE', 'th': 'th-TH', @@ -74,9 +80,9 @@ export function isDefaultLocale (locale: string) { } export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) { - // FIXME: remove disable rule when the client is upgraded to typescript 3.7 - // eslint-disable-next-line - return translations && translations[str] ? translations[str] : str + if (!translations || !translations[str]) return str + + return translations[str] } const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l)