aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/core-utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-20 16:14:09 +0200
committerChocobozzz <me@florianbigard.com>2021-04-20 16:14:09 +0200
commit67baf6478a56e4fabb22da27ee91783add7ed369 (patch)
tree13049588468e41104ace09c79b98d02b6676c09f /shared/core-utils
parent24a792404cac0dffff91853af33310fbb7a30297 (diff)
downloadPeerTube-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.ts6
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
77export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) { 77export 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
83const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) 83const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l)