From 1fa8d8281371db25ef9382b6087b7f3c0db73fe3 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 19 Jan 2022 14:45:06 +0100 Subject: refactor(config): move defaultLocale as property of config.locales I will need the country code, so I think it makes more sense to gather them inside the same property. --- src/utils/helpers/i18n.ts | 3 ++- src/utils/helpers/rss.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/utils/helpers') diff --git a/src/utils/helpers/i18n.ts b/src/utils/helpers/i18n.ts index 38616a2..18f966a 100644 --- a/src/utils/helpers/i18n.ts +++ b/src/utils/helpers/i18n.ts @@ -1,3 +1,4 @@ +import { config } from '@config/website'; import type { I18n } from '@lingui/core'; import { en, fr } from 'make-plural/plurals'; @@ -11,7 +12,7 @@ export const locales = { fr: 'Français', }; -export const defaultLocale = 'fr'; +export const defaultLocale = config.locales.defaultLocale; export function initTranslation(i18n: I18n): void { i18n.loadLocaleData({ diff --git a/src/utils/helpers/rss.ts b/src/utils/helpers/rss.ts index 7851ff8..7806f7c 100644 --- a/src/utils/helpers/rss.ts +++ b/src/utils/helpers/rss.ts @@ -39,7 +39,7 @@ export const generateFeed = async () => { }, generator: 'Feed & NextJS', id: websiteUrl, - language: config.defaultLocale, + language: config.locales.defaultLocale, link: websiteUrl, title, }); -- cgit v1.2.3