react-i18nify
Advanced tools
Comparing version 1.2.1 to 1.3.1
@@ -6,28 +6,20 @@ 'use strict'; | ||
}); | ||
exports.Localize = exports.Translate = exports.I18n = undefined; | ||
var _I18n = require('./lib/I18n'); | ||
Object.defineProperty(exports, 'I18n', { | ||
enumerable: true, | ||
get: function get() { | ||
return _I18n.I18n; | ||
} | ||
}); | ||
var _I18n2 = _interopRequireDefault(_I18n); | ||
var _Translate = require('./lib/Translate'); | ||
Object.defineProperty(exports, 'Translate', { | ||
enumerable: true, | ||
get: function get() { | ||
return _Translate.Translate; | ||
} | ||
}); | ||
var _Translate2 = _interopRequireDefault(_Translate); | ||
var _Localize = require('./lib/Localize'); | ||
Object.defineProperty(exports, 'Localize', { | ||
enumerable: true, | ||
get: function get() { | ||
return _Localize.Localize; | ||
} | ||
}); | ||
var _Localize2 = _interopRequireDefault(_Localize); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.I18n = _I18n2.default; | ||
exports.Translate = _Translate2.default; | ||
exports.Localize = _Localize2.default; |
@@ -17,2 +17,6 @@ 'use strict'; | ||
var _formatMissingTranslation = require('./formatMissingTranslation'); | ||
var _formatMissingTranslation2 = _interopRequireDefault(_formatMissingTranslation); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -78,4 +82,3 @@ | ||
} catch (err) { | ||
console.error('I18n: Translation ' + this._locale + '.' + key + ' not found'); | ||
return key; | ||
return (0, _formatMissingTranslation2.default)(key); | ||
} | ||
@@ -102,3 +105,2 @@ Object.keys(replacements).forEach(function (replacement) { | ||
} | ||
console.error('I18n: Localization of ' + value + ' failed'); | ||
return value; | ||
@@ -105,0 +107,0 @@ }, |
@@ -35,2 +35,3 @@ var React = require('react'); | ||
console.log(I18n.l(Math.PI, { maximumFractionDigits: 2 })); | ||
console.log(I18n.l('application.weird_key')); | ||
@@ -37,0 +38,0 @@ function AwesomeComponent() { |
{ | ||
"name": "react-i18nify", | ||
"version": "1.2.1", | ||
"version": "1.3.1", | ||
"description": "Simple i18n translation and localization components and helpers for React applications.", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
@@ -119,2 +119,4 @@ # react-i18nify | ||
I18n.l(Math.PI, { maximumFractionDigits: 2 }); // => returns '3,14' for locale 'nl' | ||
I18n.l('application.weird_key'); // => returns 'Weird key' as translation is missing | ||
``` | ||
@@ -121,0 +123,0 @@ |
@@ -1,3 +0,8 @@ | ||
export { I18n } from './lib/I18n'; | ||
export { Translate } from './lib/Translate'; | ||
export { Localize } from './lib/Localize'; | ||
import I18n from './lib/I18n'; | ||
export { I18n }; | ||
import Translate from './lib/Translate'; | ||
export { Translate }; | ||
import Localize from './lib/Localize'; | ||
export { Localize }; |
import moment from 'moment'; | ||
import 'moment/min/locales'; | ||
import IntlPolyfill from 'intl'; | ||
import formatMissingTranslation from './formatMissingTranslation'; | ||
@@ -66,4 +67,3 @@ export default { | ||
} catch (err) { | ||
console.error(`I18n: Translation ${this._locale}.${key} not found`); | ||
return key; | ||
return formatMissingTranslation(key); | ||
} | ||
@@ -92,3 +92,2 @@ Object.keys(replacements).forEach(replacement => { | ||
} | ||
console.error(`I18n: Localization of ${value} failed`); | ||
return value; | ||
@@ -95,0 +94,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19412
16
384
128