mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-05 20:41:43 -07:00
feat: i18n persistence on logout
This commit is contained in:
parent
80f1ab4185
commit
d19bf07382
3 changed files with 12 additions and 6 deletions
|
@ -32,7 +32,7 @@ function SettingsComponent() {
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Select native value={i18n.language} onChange={handleChange()}>
|
<Select native value={i18n.language} onChange={handleChange()}>
|
||||||
<option value={"en"}>English</option>
|
<option value={"en"}>English</option>
|
||||||
<option value={"es-ES"}>Spanish</option>
|
<option value={"es-ES"}>Español</option>
|
||||||
</Select>
|
</Select>
|
||||||
</Grid>
|
</Grid>
|
||||||
</AccordionDetails>
|
</AccordionDetails>
|
||||||
|
|
|
@ -11,15 +11,19 @@ i18n
|
||||||
.use(Backend)
|
.use(Backend)
|
||||||
.init({
|
.init({
|
||||||
compatibilityJSON: "v4",
|
compatibilityJSON: "v4",
|
||||||
lng: userLanguage || "en",
|
//lng: "en",
|
||||||
fallbackLng: "en",
|
fallbackLng: "en",
|
||||||
debug: false,
|
detection: {
|
||||||
|
order: ["path", "cookie", "localStorage", "htmlTag"],
|
||||||
|
caches: ["localStorage", "cookie"], // cache user language on
|
||||||
|
},
|
||||||
|
debug: true,
|
||||||
//keySeparator: false, // we use content as keys
|
//keySeparator: false, // we use content as keys
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: true,
|
escapeValue: true,
|
||||||
},
|
},
|
||||||
react: {
|
react: {
|
||||||
useSuspense: false,
|
useSuspense: true,
|
||||||
},
|
},
|
||||||
supportedLngs: ["en", "es-ES"],
|
supportedLngs: ["en", "es-ES"],
|
||||||
backend: {
|
backend: {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
import React from "react";
|
import React, { Suspense } from "react";
|
||||||
import ReactDOM from "react-dom";
|
import ReactDOM from "react-dom";
|
||||||
|
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
|
@ -9,7 +9,9 @@ import "./i18n";
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<App />
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
|
<App />
|
||||||
|
</Suspense>
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
document.getElementById("root")
|
document.getElementById("root")
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue