Allow plugins to set short translation locale

This commit is contained in:
Chocobozzz
2021-04-20 16:14:09 +02:00
parent 24a792404c
commit 67baf6478a
3 changed files with 10 additions and 8 deletions

View File

@@ -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)