How to use the react-i18nify.Localize function in react-i18nify

To help you get started, we’ve selected a few react-i18nify 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 artisavotins / react-redux-i18n / build / index.js View on Github external
Object.defineProperty(exports, 'i18nReducer', {
  enumerable: true,
  get: function get() {
    return _interopRequireDefault(_reducer).default;
  }
});
exports.syncTranslationWithStore = syncTranslationWithStore;

var _reactI18nify = require('react-i18nify');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.I18n = _reactI18nify.I18n;
exports.Translate = _reactI18nify.Translate;
exports.Localize = _reactI18nify.Localize;
function syncTranslationWithStore(store) {
  _reactI18nify.I18n.setTranslationsGetter(function () {
    try {
      return store.getState().i18n.translations;
    } catch (e) {
      console.error('Error getting translations from store!');
    }
  });
  _reactI18nify.I18n.setLocaleGetter(function () {
    try {
      return store.getState().i18n.locale;
    } catch (e) {
      console.error('Error getting locale from store!');
    }
  });
}