Use i18next and extract strings
This commit is contained in:
parent
d2e5bcc4cb
commit
2534ff289e
26 changed files with 588 additions and 162 deletions
28
crabfit-frontend/src/i18n/index.ts
Normal file
28
crabfit-frontend/src/i18n/index.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import i18n from 'i18next';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
import Backend from 'i18next-http-backend';
|
||||
|
||||
i18n
|
||||
.use(LanguageDetector)
|
||||
.use(Backend)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
fallbackLng: 'en-US',
|
||||
debug: true,
|
||||
load: 'currentOnly',
|
||||
interpolation: {
|
||||
escapeValue: false,
|
||||
},
|
||||
backend: {
|
||||
loadPath: '/i18n/{{lng}}/{{ns}}.json',
|
||||
requestOptions: {
|
||||
cache: 'no-cache'
|
||||
},
|
||||
customHeaders: {
|
||||
pragma: 'no-cache',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
Loading…
Add table
Add a link
Reference in a new issue