-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04325ef
commit f2e3ebb
Showing
6 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
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,23 @@ | ||
import i18n from 'i18next'; | ||
import LanguageDetector from 'i18next-browser-languagedetector'; | ||
import { initReactI18next } from 'react-i18next'; | ||
import resources from '../locales/resources'; | ||
|
||
const options = { | ||
resources, | ||
fallbackLng: 'fr_FR', | ||
ns: ['extension'], | ||
defaultNS: 'extension', | ||
debug: true, | ||
interpolation: { | ||
escapeValue: false // react already safes from xss | ||
}, | ||
keySeparator: '.' | ||
}; | ||
|
||
i18n | ||
.use(initReactI18next) | ||
.use(LanguageDetector) | ||
.init(options); | ||
|
||
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
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 @@ | ||
{} |
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,6 @@ | ||
{ | ||
"Contributions": "Contributions", | ||
"Abonnements": "Test", | ||
"Aide": "Aide", | ||
"Mon compte": "Mon compte" | ||
} |
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,15 @@ | ||
import extensionFR from './extension/fr_FR.json'; | ||
import extensionEN from './extension/en_GB.json'; | ||
|
||
const resources = { | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
fr_FR: { | ||
extension: extensionFR | ||
}, | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
en_GB: { | ||
extension: extensionEN | ||
} | ||
}; | ||
|
||
export default resources; |
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