diff options
Diffstat (limited to 'client/src/app/shared/i18n')
-rw-r--r-- | client/src/app/shared/i18n/i18n-utils.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/client/src/app/shared/i18n/i18n-utils.ts b/client/src/app/shared/i18n/i18n-utils.ts index c1de51b7b..37180b930 100644 --- a/client/src/app/shared/i18n/i18n-utils.ts +++ b/client/src/app/shared/i18n/i18n-utils.ts | |||
@@ -1,7 +1,19 @@ | |||
1 | import { environment } from '../../../environments/environment' | ||
2 | |||
1 | function peertubeTranslate (str: string, translations: { [ id: string ]: string }) { | 3 | function peertubeTranslate (str: string, translations: { [ id: string ]: string }) { |
2 | return translations[str] ? translations[str] : str | 4 | return translations[str] ? translations[str] : str |
3 | } | 5 | } |
4 | 6 | ||
7 | function isOnDevLocale () { | ||
8 | return environment.production === false && window.location.search === '?lang=fr' | ||
9 | } | ||
10 | |||
11 | function getDevLocale () { | ||
12 | return 'fr' | ||
13 | } | ||
14 | |||
5 | export { | 15 | export { |
16 | getDevLocale, | ||
17 | isOnDevLocale, | ||
6 | peertubeTranslate | 18 | peertubeTranslate |
7 | } | 19 | } |