How to use the addResourceBundle function from i18next

Find comprehensive JavaScript i18next.addResourceBundle code examples handpicked from public code repositorys.

84
85
86
87
88
89
90
91
92
93
window.i18n = i18next
console.log('adding language', lang, json)

// for some reason, 'pt-br' was not working, use just pt instead
const k = lang.split('-')[0]
i18next.addResourceBundle(k, 'translation', json)

const languages = {}
updateAvailableLanguages()
emitter.emit('render')
fork icon228
star icon0
watch icon62

+ 3 other calls in file

36
37
38
39
40
41
42
    i18n.changeLanguage(locale);
  }
}

function addResourceBundle(lng, ns, resources) {
  i18n.addResourceBundle(lng, ns, resources);
}
fork icon3
star icon22
watch icon3