Updated translations

This commit is contained in:
vjrj 2017-12-21 11:36:00 +01:00
parent e3eddd6b85
commit 91b4197b04
5 changed files with 68 additions and 7 deletions

View file

@ -1,5 +1,6 @@
/* global CookieConsent Intl */
import i18n from 'i18next';
import { Meteor } from 'meteor/meteor';
import backend from 'i18next-xhr-backend';
import LngDetector from 'i18next-browser-languagedetector';
import Cache from 'i18next-localstorage-cache';
@ -48,6 +49,15 @@ i18nOpts.react = {
nsMode: 'default' */
};
const sendMissing = false;
if (sendMissing && !Meteor.isProduction) {
i18nOpts.sendMissing = true;
i18nOpts.sendMissingTo = 'fallback';
i18nOpts.missingKeyHandler = function miss(lng, ns, key, defaultValue, lngs) {
Meteor.call('utility.saveMissingI18n', key, defaultValue);
};
}
i18n.use(backend)
.use(LngDetector)
.use(Cache)