Use i18next and extract strings

This commit is contained in:
Ben Grant 2021-05-18 21:28:14 +10:00
parent d2e5bcc4cb
commit 2534ff289e
26 changed files with 588 additions and 162 deletions

View 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;