diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-20 16:14:09 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-20 16:14:09 +0200 |
commit | 67baf6478a56e4fabb22da27ee91783add7ed369 (patch) | |
tree | 13049588468e41104ace09c79b98d02b6676c09f /shared/core-utils | |
parent | 24a792404cac0dffff91853af33310fbb7a30297 (diff) | |
download | PeerTube-67baf6478a56e4fabb22da27ee91783add7ed369.tar.gz PeerTube-67baf6478a56e4fabb22da27ee91783add7ed369.tar.zst PeerTube-67baf6478a56e4fabb22da27ee91783add7ed369.zip |
Allow plugins to set short translation locale
Diffstat (limited to 'shared/core-utils')
-rw-r--r-- | shared/core-utils/i18n/i18n.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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) { | |||
75 | } | 75 | } |
76 | 76 | ||
77 | export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) { | 77 | export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) { |
78 | // FIXME: remove disable rule when the client is upgraded to typescript 3.7 | 78 | if (!translations || !translations[str]) return str |
79 | // eslint-disable-next-line | 79 | |
80 | return translations && translations[str] ? translations[str] : str | 80 | return translations[str] |
81 | } | 81 | } |
82 | 82 | ||
83 | const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) | 83 | const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) |