From 67baf6478a56e4fabb22da27ee91783add7ed369 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 20 Apr 2021 16:14:09 +0200 Subject: Allow plugins to set short translation locale --- shared/core-utils/i18n/i18n.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'shared') diff --git a/shared/core-utils/i18n/i18n.ts b/shared/core-utils/i18n/i18n.ts index a342cb3f8..f27de20f1 100644 --- a/shared/core-utils/i18n/i18n.ts +++ b/shared/core-utils/i18n/i18n.ts @@ -75,9 +75,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) -- cgit v1.2.3