This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #1668
- Loading branch information
Showing
3 changed files
with
27 additions
and
46 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import i18n from 'i18next'; | ||
import Backend from 'i18next-xhr-backend'; | ||
import LanguageDetector from 'i18next-browser-languagedetector'; | ||
import { initReactI18next } from 'react-i18next'; | ||
|
||
i18n | ||
// load translation using xhr -> see /public/locales | ||
// learn more: https://github.com/i18next/i18next-xhr-backend | ||
.use(Backend) | ||
// detect user language | ||
// learn more: https://github.com/i18next/i18next-browser-languageDetector | ||
.use(LanguageDetector) | ||
// pass the i18n instance to react-i18next. | ||
.use(initReactI18next) | ||
// init i18next | ||
// for all options read: https://www.i18next.com/overview/configuration-options | ||
.init({ | ||
fallbackLng: 'en', | ||
debug: true, | ||
|
||
interpolation: { | ||
escapeValue: false, // not needed for react as it escapes by default | ||
}, | ||
}); | ||
|
||
export default i18n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters