feat: locale namespacing save + auth fetch fix

This commit is contained in:
NGPixel
2018-05-28 19:36:35 -04:00
parent 416755f17a
commit dd318eb2db
11 changed files with 69 additions and 51 deletions

View File

@@ -17,7 +17,7 @@ module.exports = {
ns: this.namespaces,
defaultNS: 'common',
saveMissing: false,
lng: WIKI.config.lang,
lng: WIKI.config.lang.code,
fallbackLng: 'en'
})
@@ -31,7 +31,7 @@ module.exports = {
}
// Load current language
this.loadLocale(WIKI.config.lang, { silent: true })
this.loadLocale(WIKI.config.lang.code, { silent: true })
return this
},
@@ -55,7 +55,6 @@ module.exports = {
const res = await WIKI.db.locales.query().findOne('code', locale)
if (res) {
if (_.isPlainObject(res.strings)) {
console.info(res.strings)
_.forOwn(res.strings, (data, ns) => {
this.namespaces.push(ns)
this.engine.addResourceBundle(locale, ns, data, true, true)