1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 00:35:26 +03:00

Replace i18next http backend by filesystem sync backend

This commit is contained in:
Miguel Angel Mulero Martinez 2020-10-21 10:35:35 +02:00
parent 7d3306aecb
commit 60d58e7ac9
5 changed files with 10 additions and 16 deletions

View file

@ -20,8 +20,10 @@ const languageFallback = {
i18n.init = function(cb) {
getStoredUserLocale(function(userLanguage) {
const I18NextFsBackend = require('i18next-fs-backend');
i18next
.use(i18nextHttpBackend)
.use(I18NextFsBackend)
.init({
lng: userLanguage,
getAsync: false,
@ -30,9 +32,10 @@ i18n.init = function(cb) {
defaultNS:['messages'],
fallbackLng: languageFallback,
backend: {
loadPath: '/_locales/{{lng}}/{{ns}}.json',
loadPath: './_locales/{{lng}}/{{ns}}.json',
parse: i18n.parseInputFile,
},
initImmediate: false,
},
function(err) {
if (err !== undefined) {