diff options
Diffstat (limited to 'client/src/app/helpers/i18n-utils.ts')
-rw-r--r-- | client/src/app/helpers/i18n-utils.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/helpers/i18n-utils.ts b/client/src/app/helpers/i18n-utils.ts index 2017a31ea..b7d73d16b 100644 --- a/client/src/app/helpers/i18n-utils.ts +++ b/client/src/app/helpers/i18n-utils.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { environment } from '../../environments/environment' | ||
2 | import IntlMessageFormat from 'intl-messageformat' | 1 | import IntlMessageFormat from 'intl-messageformat' |
2 | import { logger } from '@root-helpers/logger' | ||
3 | import { environment } from '../../environments/environment' | ||
3 | 4 | ||
4 | function isOnDevLocale () { | 5 | function isOnDevLocale () { |
5 | return environment.production === false && window.location.search === '?lang=fr' | 6 | return environment.production === false && window.location.search === '?lang=fr' |
@@ -19,14 +20,14 @@ function prepareIcu (icu: string) { | |||
19 | try { | 20 | try { |
20 | return msg.format(context) as string | 21 | return msg.format(context) as string |
21 | } catch (err) { | 22 | } catch (err) { |
22 | if (!alreadyWarned) console.warn('Cannot format ICU %s.', icu, err) | 23 | if (!alreadyWarned) logger.warn(`Cannot format ICU ${icu}.`, err) |
23 | 24 | ||
24 | alreadyWarned = true | 25 | alreadyWarned = true |
25 | return fallback | 26 | return fallback |
26 | } | 27 | } |
27 | } | 28 | } |
28 | } catch (err) { | 29 | } catch (err) { |
29 | console.warn('Cannot build intl message %s.', icu, err) | 30 | logger.warn(`Cannot build intl message ${icu}.`, err) |
30 | 31 | ||
31 | return (_context: unknown, fallback: string) => fallback | 32 | return (_context: unknown, fallback: string) => fallback |
32 | } | 33 | } |