Skip to content

Commit

Permalink
feat: initialize i18next for internationalization
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Dec 21, 2023
1 parent cd7e3d2 commit b40f608
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/common/i18n.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import i18n from 'i18next';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';

i18n
.use(Backend)
.use(LanguageDetector)
.init({
fallbackLng: 'en',
debug: true,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
react: {
useSuspense: false,
},
backend: {
loadPath: '/locales/{{lng}}/{{ns}}.json',
},
});

export default i18n;

0 comments on commit b40f608

Please sign in to comment.