mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-27 13:21:32 +00:00
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);
|
||||
}
|
||||
|
|
21
ui/src/i18next.ts
vendored
21
ui/src/i18next.ts
vendored
|
@ -65,16 +65,15 @@ function format(value: any, format: any, lng: any): any {
|
|||
return format === 'uppercase' ? value.toUpperCase() : value;
|
||||
}
|
||||
|
||||
export function i18nextSetup() {
|
||||
i18next.init({
|
||||
debug: false,
|
||||
// load: 'languageOnly',
|
||||
i18next.init({
|
||||
debug: false,
|
||||
// load: 'languageOnly',
|
||||
|
||||
// initImmediate: false,
|
||||
lng: getLanguage(),
|
||||
fallbackLng: 'en',
|
||||
resources,
|
||||
interpolation: { format },
|
||||
});
|
||||
|
||||
// initImmediate: false,
|
||||
lng: getLanguage(),
|
||||
fallbackLng: 'en',
|
||||
resources,
|
||||
interpolation: { format },
|
||||
});
|
||||
}
|
||||
export { i18next as i18n, resources };
|
||||
|
|
Loading…
Reference in a new issue