aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/i18n
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-16 10:48:35 +0200
committerChocobozzz <me@florianbigard.com>2018-08-16 10:48:35 +0200
commit3dfa84940273619ae00f11a5f419a5e4876b2f53 (patch)
treebd31beeb985a9696af90e15ff6b767c4a0da03d9 /shared/models/i18n
parent4f1f6f038389ce9cdf0c77dfccdc63efc6948101 (diff)
downloadPeerTube-3dfa84940273619ae00f11a5f419a5e4876b2f53.tar.gz
PeerTube-3dfa84940273619ae00f11a5f419a5e4876b2f53.tar.zst
PeerTube-3dfa84940273619ae00f11a5f419a5e4876b2f53.zip
Translate subtitle langs in player
Diffstat (limited to 'shared/models/i18n')
-rw-r--r--shared/models/i18n/i18n.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.ts
index 2530a1927..c5de972ac 100644
--- a/shared/models/i18n/i18n.ts
+++ b/shared/models/i18n/i18n.ts
@@ -36,6 +36,10 @@ export function isDefaultLocale (locale: string) {
36 return getCompleteLocale(locale) === getCompleteLocale(getDefaultLocale()) 36 return getCompleteLocale(locale) === getCompleteLocale(getDefaultLocale())
37} 37}
38 38
39export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) {
40 return translations && translations[str] ? translations[str] : str
41}
42
39const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) 43const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l)
40export function is18nPath (path: string) { 44export function is18nPath (path: string) {
41 return possiblePaths.indexOf(path) !== -1 45 return possiblePaths.indexOf(path) !== -1