Add basic frontend structure
This commit is contained in:
parent
486977f828
commit
25b7c24c65
29 changed files with 4659 additions and 3811 deletions
32
frontend/src/lib/i18n.ts
Normal file
32
frontend/src/lib/i18n.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import i18next from 'i18next'
|
||||
import Backend from 'i18next-chained-backend'
|
||||
import Fetch from 'i18next-fetch-backend'
|
||||
import LocalStorageBackend from 'i18next-localstorage-backend'
|
||||
import I18nextBrowserLanguageDetector from 'i18next-browser-languagedetector'
|
||||
import { createI18nStore } from './i18n-store'
|
||||
|
||||
i18next
|
||||
.use(Backend)
|
||||
.use(I18nextBrowserLanguageDetector)
|
||||
.init({
|
||||
supportedLngs: ['en', 'de'],
|
||||
ns: ['common'],
|
||||
defaultNS: 'common',
|
||||
backend: {
|
||||
backends: [LocalStorageBackend, Fetch],
|
||||
backendOptions: [
|
||||
{
|
||||
expirationTime: 24 * 60 * 60 * 1000,
|
||||
},
|
||||
{
|
||||
loadPath: '/locales/{{lng}}/{{ns}}.json',
|
||||
},
|
||||
],
|
||||
},
|
||||
interpolation: {
|
||||
escapeValue: false,
|
||||
},
|
||||
})
|
||||
|
||||
const i18n = createI18nStore(i18next)
|
||||
export default i18n
|
Loading…
Add table
Add a link
Reference in a new issue