From 74b7c6d48e9ca377fe938c8134ed74b612e62ba0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 6 Jun 2018 17:37:13 +0200 Subject: Little i18n refractoring --- client/src/app/shared/i18n/i18n-utils.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'client/src/app/shared/i18n') 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 @@ +import { environment } from '../../../environments/environment' + function peertubeTranslate (str: string, translations: { [ id: string ]: string }) { return translations[str] ? translations[str] : str } +function isOnDevLocale () { + return environment.production === false && window.location.search === '?lang=fr' +} + +function getDevLocale () { + return 'fr' +} + export { + getDevLocale, + isOnDevLocale, peertubeTranslate } -- cgit v1.2.3