aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-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