Skip to content

Commit

Permalink
persist language settings
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed May 22, 2024
1 parent 473ed46 commit 85da61f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/settings/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ export default function Page() {
value={i18n.language}
onChange={(val) => {
i18n.changeLanguage(val || "en_US");
localStorage.setItem("lang", val || "en_US");
}}
/>
</Group>
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ i18n.use(initReactI18next).init({
en: en_US,
zh_CN: zh_CN,
},
lng: "zh_CN",
lng: localStorage.getItem("lang") || "en_US",
fallbackLng: "en",
});

Expand Down

0 comments on commit 85da61f

Please sign in to comment.