Add basic frontend structure

This commit is contained in:
Oliver Traber 2025-03-18 17:23:26 +00:00 committed by Bluemedia
parent 486977f828
commit 25b7c24c65
Signed by: Bluemedia
GPG key ID: C0674B105057136C
29 changed files with 4659 additions and 3811 deletions

32
frontend/src/lib/i18n.ts Normal file
View 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