Skip to content

Commit

Permalink
feat(i18n): use navigator language as default locale
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Oct 8, 2021
1 parent db0cc19 commit 50627f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ const i18n = createI18n({
legacy: false,
// Makes i18n functions ($i18n, $t, $d, ...) available in all components templates
globalInjection: true,
// Default & fallback locales
locale: "fr",
// Set default locale according to navigator language
locale: navigator.language.slice(0, 2),
// Fallback to english if no translation available
fallbackLocale: "en",

messages: {
Expand Down

0 comments on commit 50627f5

Please sign in to comment.