feat: update user language when the language changed on login page (#3628)

This commit is contained in:
WindSpiritSR
2025-03-01 22:28:20 +08:00
committed by GitHub
parent cb1882e589
commit 5692522ee0
4 changed files with 20 additions and 2 deletions

View File

@ -30,6 +30,7 @@ class LanguageSelect extends React.Component {
this.state = {
classes: props,
languages: props.languages ?? Setting.Countries.map(item => item.key),
onClick: props.onClick,
};
Setting.Countries.forEach((country) => {
@ -50,6 +51,9 @@ class LanguageSelect extends React.Component {
render() {
const languageItems = this.getOrganizationLanguages(this.state.languages);
const onClick = (e) => {
if (typeof this.state.onClick === "function") {
this.state.onClick(e.key);
}
Setting.setLanguage(e.key);
};