diff options
Diffstat (limited to 'shared/models/i18n/i18n.ts')
-rw-r--r-- | shared/models/i18n/i18n.ts | 4 |
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 | ||
39 | export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) { | ||
40 | return translations && translations[str] ? translations[str] : str | ||
41 | } | ||
42 | |||
39 | const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) | 43 | const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) |
40 | export function is18nPath (path: string) { | 44 | export function is18nPath (path: string) { |
41 | return possiblePaths.indexOf(path) !== -1 | 45 | return possiblePaths.indexOf(path) !== -1 |