Skip to content

Commit

Permalink
chore: simplify i18n comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-xo committed May 6, 2024
1 parent 24e8a24 commit 4005b3b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ import * as i18n from '#app/modules/i18n/i18n'

async function main() {
await i18next
.use(initReactI18next) // Tell i18next to use the react-i18next plugin
.use(I18nextBrowserLanguageDetector) // Setup a client-side language detector
.use(initReactI18next) // Initialize `react-i18next`.
.use(I18nextBrowserLanguageDetector) // Setup client-side language detector.
.init({
...i18n,
ns: getInitialNamespaces(),
detection: {
// Here only enable htmlTag detection, we'll detect the language only
// server-side with remix-i18next, by using the `<html lang>` attribute
// we can communicate to the client the language detected server-side
// Enable HTML tag detection only by detecting the language server-side.
// Using `<html lang>` attribute to communicate the detected language to the client.
order: ['htmlTag'],
// Because we only use htmlTag, there's no reason to cache the language
// on the browser, so we disable it
// Since we solely utilize htmlTag, browser language caching is unnecessary.
caches: [],
},
})
Expand Down

0 comments on commit 4005b3b

Please sign in to comment.