-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now using useTranslations independently from cgpv
- Loading branch information
1 parent
06f2941
commit dc3cfd4
Showing
6 changed files
with
968 additions
and
856 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
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
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,34 @@ | ||
import i18n from 'i18next'; | ||
import { initReactI18next } from 'react-i18next'; | ||
|
||
import translationEn from '../locales/en/translation.json'; | ||
import translationFr from '../locales/fr/translation.json'; | ||
|
||
i18n | ||
.use(initReactI18next) | ||
// init i18next | ||
// for all options read: https://www.i18next.com/overview/configuration-options | ||
.init({ | ||
debug: false, | ||
lng: 'en', | ||
fallbackLng: ['en', 'fr'], | ||
supportedLngs: ['en', 'fr'], | ||
interpolation: { | ||
escapeValue: false, // not needed for react as it escapes by default | ||
}, | ||
resources: { | ||
en: { | ||
translation: translationEn, | ||
}, | ||
fr: { | ||
translation: translationFr, | ||
}, | ||
}, | ||
// special options for react-i18next | ||
// learn more: https://react.i18next.com/components/i18next-instance | ||
react: { | ||
useSuspense: true, | ||
}, | ||
}); | ||
|
||
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