How to use the i18next.services function in i18next

To help you get started, we’ve selected a few i18next examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github i18next / i18next-xhr-backend / test / xhr.spec.js View on Github external
it('should load json5 data', done => {
      backend = new XHR(
        {
          interpolator: i18next.services.interpolator,
        },
        {
          loadPath: 'http://localhost:9876/locales/{{lng}}/{{ns}}.json5',
          parse: JSON5.parse,
        },
      );
      backend.read('en', 'test', function(err, data) {
        expect(err).to.be.not.ok;
        expect(data).to.eql({ key: 'passing' });
        done();
      });
    });
  });
github i18next / i18next-xhr-backend / test / xhr.spec.js View on Github external
before(() => {
      backend = new XHR(
        {
          interpolator: i18next.services.interpolator,
        },
        {
          loadPath: 'http://localhost:9876/locales/{{lng}}/{{ns}}.json',
        },
      );
    });
github allure-framework / allure2 / allure-generator / src / main / javascript / utils / translation.js View on Github external
i18next.on('initialized', () => {
        i18next.services.resourceStore.addResourceBundle(lang, i18next.options.ns[0], json, true, true);
    });
}
github allure-framework / allure2 / allure-web / src / util / translation.js View on Github external
i18next.on('initialized', () => {
        i18next.services.resourceStore.addResourceBundle(lang, i18next.options.ns[0], json);
    });
}
github allure-framework / allure1 / allure-report-face / src / util / translation.js View on Github external
i18next.on('initialized', () => {
        i18next.services.resourceStore.addResourceBundle(lang, i18next.options.ns[0], json);
    });
}
github i18next / i18nextify / src / localize.js View on Github external
export default function localize(node, retranslate) {
  const recurseTime = new Instrument();
  recurseTime.start();

  const localized = walk(node, null, null, null, null, { retranslate });

  i18next.services.logger.log(`localization took: ${recurseTime.end()}ms`);

  return localized;
}
github i18next / i18nextify / src / missingHandler.js View on Github external
function log() {
  i18next.services.logger.log('missing resources: \n' + JSON.stringify(missings, null, 2));
}
github polkadot-js / apps / packages / react-components / src / i18n.ts View on Github external
uiSettings.on('change', settings => {
  const lang = settings.i18nLang === LANGUAGE_DEFAULT
    ? i18n.services.languageDetector.detect()
    : settings.i18nLang;
  i18n.changeLanguage(lang);
});