Public Access
fix(settings): keep the language and save settings one after the other
This commit is contained in:
1 parent
14dd59f9e0
commit
f605917874
25 files changed
+423
-98
No files matched your search
+4
-1
@@ -1,12 +1,13 @@
|
||||
import i18n from 'i18next';
|
||||
import {initReactI18next} from 'react-i18next';
|
||||
import HttpBackend from 'i18next-http-backend';
|
||||
import {cacheLanguage, readCachedLanguage} from './utils/settings.js';
|
||||
|
||||
|
||||
i18n.use(HttpBackend)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
lng: 'de',
|
||||
lng: readCachedLanguage() ?? 'de',
|
||||
fallbackLng: 'en',
|
||||
backend: {
|
||||
// A browser kept an old file without its Cache-Control and showed raw keys; a new URL per version avoids that.
|
||||
@@ -17,4 +18,6 @@ i18n.use(HttpBackend)
|
||||
}
|
||||
});
|
||||
|
||||
i18n.on('languageChanged', cacheLanguage);
|
||||
|
||||
export default i18n;
|
||||
Reference in new issue
Block a user