Fix an issue with user language setting.
This commit is contained in:
parent
5dd0efb280
commit
19db9dea30
2 changed files with 12 additions and 14 deletions
5
ui/src/components/navbar.tsx
vendored
5
ui/src/components/navbar.tsx
vendored
|
@ -31,7 +31,7 @@ import {
|
|||
md,
|
||||
setTheme,
|
||||
} from '../utils';
|
||||
import { i18n, i18nextSetup } from '../i18next';
|
||||
import { i18n } from '../i18next';
|
||||
|
||||
interface NavbarState {
|
||||
isLoggedIn: boolean;
|
||||
|
@ -435,12 +435,11 @@ export class Navbar extends Component<any, NavbarState> {
|
|||
this.requestNotificationPermission();
|
||||
this.fetchUnreads();
|
||||
setTheme(data.my_user.theme, true);
|
||||
i18n.changeLanguage(data.my_user.lang);
|
||||
}
|
||||
this.state.isLoggedIn = true;
|
||||
}
|
||||
|
||||
i18nextSetup();
|
||||
|
||||
this.state.siteLoading = false;
|
||||
this.setState(this.state);
|
||||
}
|
||||
|
|
3
ui/src/i18next.ts
vendored
3
ui/src/i18next.ts
vendored
|
@ -65,7 +65,6 @@ function format(value: any, format: any, lng: any): any {
|
|||
return format === 'uppercase' ? value.toUpperCase() : value;
|
||||
}
|
||||
|
||||
export function i18nextSetup() {
|
||||
i18next.init({
|
||||
debug: false,
|
||||
// load: 'languageOnly',
|
||||
|
@ -76,5 +75,5 @@ export function i18nextSetup() {
|
|||
resources,
|
||||
interpolation: { format },
|
||||
});
|
||||
}
|
||||
|
||||
export { i18next as i18n, resources };
|
||||
|
|
Loading…
Reference in a new issue