Skip to content

Commit

Permalink
fix: in some case, the language of moment can be changed, breaking th…
Browse files Browse the repository at this point in the history
…e translation
  • Loading branch information
Mara-Li committed Aug 7, 2024
1 parent dc4c018 commit b33fc94
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/i18n/i18next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ export const resources = {
en: { translation: en },
fr: { translation: fr },
} as const;
export const translationLanguage = Object.keys(resources).find(
(i) => i == moment.locale()
)
? moment.locale()

const localeUsed = window.localStorage.language || moment.locale();

export const translationLanguage = Object.keys(resources).find((i) => i == localeUsed)
? localeUsed
: "en";

0 comments on commit b33fc94

Please sign in to comment.