Public Access
The translation files get a content version in their URL, so a browser that cached an old file loads the new one. On touch screens the scroll lock of menus and selects no longer adds a right margin: Android Chrome reported one and the whole page became narrower.
20 lines
559 B
JavaScript
20 lines
559 B
JavaScript
import i18n from 'i18next';
|
|
import {initReactI18next} from 'react-i18next';
|
|
import HttpBackend from 'i18next-http-backend';
|
|
|
|
|
|
i18n.use(HttpBackend)
|
|
.use(initReactI18next)
|
|
.init({
|
|
lng: '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.
|
|
loadPath: `/i18n/{{lng}}.json?v=${__TRANSLATIONS_VERSION__}`,
|
|
},
|
|
interpolation: {
|
|
escapeValue: false
|
|
}
|
|
});
|
|
|
|
export default i18n; |