mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Allow plugins to set short translation locale
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user