How to use the sync function from i18next

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

210
211
212
213
214
215
216
217
218
219

function loadResourcesForLanguage(lng) {
  return getI18nResourceStore(lng, i18next.options.ns.namespaces)
    .then(function(resStore) {
      // as of i18next-1.7.3, there is no api to do this so we edit the i18next object directly
      i18next.sync.resStore[lng] = resStore[lng];

      return resStore;
    });
}
fork icon0
star icon0
watch icon3