mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-04-19 21:09:46 +01:00
* Added localization build * Commit types * Added locProject.json * Localized file check-in by OneLocBuild Task: Build definition ID 13114: Build ID 2425084 (#2392) * Fixed package.json * Fix compilation error * Localized file check-in by OneLocBuild Task: Build definition ID 13114: Build ID 2431677 (#2396) * Localized file check-in by OneLocBuild Task: Build definition ID 13114: Build ID 2432830 (#2397) * Localized file check-in by OneLocBuild Task: Build definition ID 13114: Build ID 2431872 * Localized file check-in by OneLocBuild Task: Build definition ID 13114: Build ID 2432783 * Localized file check-in by OneLocBuild Task: Build definition ID 13114: Build ID 2432830 * Localized file check-in by OneLocBuild Task: Build definition ID 13114: Build ID 2434398 (#2400) --------- Co-authored-by: olprod <olprod@microsoft.com>
30 lines
898 B
TypeScript
30 lines
898 B
TypeScript
import i18n from "i18next";
|
|
import LanguageDetector from "i18next-browser-languagedetector";
|
|
import resourcesToBackend from "i18next-resources-to-backend";
|
|
import { initReactI18next } from "react-i18next";
|
|
|
|
i18n
|
|
.use(LanguageDetector)
|
|
.use(resourcesToBackend((lng: string, ns: string) => import(`./Localization/${lng}/${ns}.json`)))
|
|
.use(initReactI18next)
|
|
.init({
|
|
fallbackLng: "en",
|
|
defaultNS: "Resources",
|
|
ns: ["Resources"],
|
|
detection: { order: ["navigator", "cookie", "localStorage", "sessionStorage", "querystring", "htmlTag"] },
|
|
debug: process.env.NODE_ENV === "development",
|
|
keySeparator: ".",
|
|
interpolation: {
|
|
escapeValue: false,
|
|
formatSeparator: ",",
|
|
},
|
|
react: {
|
|
bindI18n: "languageChanged added loaded",
|
|
bindI18nStore: "added removed",
|
|
nsMode: "default",
|
|
useSuspense: false,
|
|
},
|
|
});
|
|
|
|
export default i18n;
|