mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-12-25 17:42:30 +00:00
* chore: add yaml config ref * feat: add initial implementation of a traefik like cli * refactor: remove dependency on traefik * chore: update example env * refactor: update build * chore: remove unused code * fix: fix translations not loading * feat: add experimental config file support * chore: mod tidy * fix: review comments * refactor: move tinyauth to separate package * chore: add quotes to all env variables * chore: resolve go mod and sum conflicts * chore: go mod tidy * fix: review comments
25 lines
611 B
TypeScript
25 lines
611 B
TypeScript
import i18n from "i18next";
|
|
import { initReactI18next } from "react-i18next";
|
|
import LanguageDetector from "i18next-browser-languagedetector";
|
|
import resourcesToBackend from "i18next-resources-to-backend";
|
|
|
|
i18n
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.use(
|
|
resourcesToBackend(
|
|
(language: string) => import(`./locales/${language}.json`),
|
|
),
|
|
)
|
|
.init({
|
|
fallbackLng: "en",
|
|
debug: import.meta.env.MODE === "development",
|
|
nonExplicitSupportedLngs: true,
|
|
load: "currentOnly",
|
|
detection: {
|
|
lookupLocalStorage: "tinyauth-lang",
|
|
},
|
|
});
|
|
|
|
export default i18n;
|