react-localize-redux
Advanced tools
Comparing version 2.13.4 to 2.13.5
@@ -110,2 +110,7 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
*/ | ||
/** | ||
* TYPES | ||
*/ | ||
var INITIALIZE = exports.INITIALIZE = '@@localize/INITIALIZE'; | ||
@@ -129,6 +134,6 @@ var ADD_TRANSLATION = exports.ADD_TRANSLATION = '@@localize/ADD_TRANSLATION'; | ||
var _options = action.payload.options || {}; | ||
var activeLanguage = action.payload.activeLanguage || _options.defaultLanguage; | ||
var _activeLanguage = action.payload.activeLanguage || _options.defaultLanguage; | ||
return action.payload.languages.map(function (language, index) { | ||
var isActive = function isActive(code) { | ||
return activeLanguage !== undefined ? code === activeLanguage : index === 0; | ||
return _activeLanguage !== undefined ? code === _activeLanguage : index === 0; | ||
}; | ||
@@ -310,3 +315,4 @@ // check if it's using array of Language objects, or array of languge codes | ||
var getTranslate = exports.getTranslate = (0, _reselect.createSelector)(getTranslationsForActiveLanguage, getActiveLanguage, getOptions, function (translations, activeLanguage, options) { | ||
return function (value, data) { | ||
return function (value) { | ||
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var optionsOverride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
@@ -652,3 +658,3 @@ | ||
* | ||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> | ||
* @author Feross Aboukhadijeh <https://feross.org> | ||
* @license MIT | ||
@@ -655,0 +661,0 @@ */ |
@@ -1,7 +0,7 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-redux"),require("redux")):"function"==typeof define&&define.amd?define(["react","react-redux","redux"],t):"object"==typeof exports?exports.ReactLocalizeRedux=t(require("react"),require("react-redux"),require("redux")):e.ReactLocalizeRedux=t(e.React,e.ReactRedux,e.Redux)}(this,function(e,t,n){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];switch(t.type){case f:case p:var n=t.payload.options||{},r=t.payload.activeLanguage||n.defaultLanguage;return t.payload.languages.map(function(e,t){var n=function(e){return void 0!==r?e===r:0===t};return"string"==typeof e?{code:e,active:n(e)}:i({},e,{active:n(e.code)})});case v:return e.map(function(e){return e.code===t.payload.languageCode?i({},e,{active:!0}):i({},e,{active:!1})});default:return e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case g:var n=void 0!==t.translationTransform?t.translationTransform(t.payload.translation,t.languageCodes):t.payload.translation;return i({},e,(0,c.flatten)(n,{safe:!0}));case d:var a=t.languageCodes.indexOf(t.payload.language),o=a>=0?(0,c.flatten)(t.payload.translation):{},u=Object.keys(o).reduce(function(n,u){var c=t.languageCodes.map(function(t,n){var r=e[u]||[];return n===a?o[u]:r[n]});return i({},n,r({},u,c))},{});return i({},e,u);default:return e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments[1];switch(t.type){case f:var n=t.payload.options||{};return i({},e,(0,s.validateOptions)(n));default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getTranslate=t.getTranslationsForActiveLanguage=t.translationsEqualSelector=t.getActiveLanguage=t.getOptions=t.getLanguages=t.getTranslations=t.setActiveLanguage=t.setLanguages=t.addTranslationForLanguage=t.addTranslation=t.initialize=t.localeReducer=t.defaultTranslateOptions=t.TRANSLATE=t.SET_ACTIVE_LANGUAGE=t.SET_LANGUAGES=t.ADD_TRANSLATION_FOR_LANGUGE=t.ADD_TRANSLATION=t.INITIALIZE=void 0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.languages=a,t.translations=o,t.options=u;var c=(n(9),n(5)),l=n(7),s=n(4),f=t.INITIALIZE="@@localize/INITIALIZE",g=t.ADD_TRANSLATION="@@localize/ADD_TRANSLATION",d=t.ADD_TRANSLATION_FOR_LANGUGE="@@localize/ADD_TRANSLATION_FOR_LANGUGE",p=t.SET_LANGUAGES="@@localize/SET_LANGUAGES",v=t.SET_ACTIVE_LANGUAGE="@@localize/SET_ACTIVE_LANGUAGE",y=(t.TRANSLATE="@@localize/TRANSLATE",t.defaultTranslateOptions={renderInnerHtml:!0,showMissingTranslationMsg:!0}),b={languages:[],translations:{},options:y},T=(t.localeReducer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t=arguments[1],n=e.languages.map(function(e){return e.code}),r=e.options.translationTransform;return{languages:a(e.languages,t),translations:o(e.translations,i({},t,{languageCodes:n,translationTransform:r})),options:u(e.options,t)}},t.initialize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y;return{type:f,payload:{languages:e,options:t}}},t.addTranslation=function(e){return{type:g,payload:{translation:e}}},t.addTranslationForLanguage=function(e,t){return{type:d,payload:{translation:e,language:t}}},t.setLanguages=function(e,t){return{type:p,payload:{languages:e,activeLanguage:t}}},t.setActiveLanguage=function(e){return{type:v,payload:{languageCode:e}}},t.getTranslations=function(e){return e.translations}),A=t.getLanguages=function(e){return e.languages},O=t.getOptions=function(e){return e.options},m=t.getActiveLanguage=function(e){return A(e).filter(function(e){return!0===e.active})[0]},L=t.translationsEqualSelector=(0,l.createSelectorCreator)(l.defaultMemoize,function(e,t){if(!(Array.isArray(e)||"code,active"===Object.keys(e).toString())){var n=t,r=e,a=Object.keys(n).toString(),o=Object.keys(r).toString();return a+" - "+(0,s.objectValuesToString)(n)==o+" - "+(0,s.objectValuesToString)(r)}return t===e}),j=t.getTranslationsForActiveLanguage=L(m,A,T,function(e,t,n){var a=e.code,o=(0,s.getIndexForLanguageCode)(a,t);return Object.keys(n).reduce(function(e,t){return i({},e,r({},t,n[t][o]))},{})});t.getTranslate=(0,l.createSelector)(j,m,O,function(e,t,n){return function(a,o){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=i({},n,u);if("string"==typeof a)return(0,s.getLocalizedElement)(a,e,o,t,c);if(Array.isArray(a))return a.reduce(function(n,a){return i({},n,r({},a,(0,s.getLocalizedElement)(a,e,o,t,c)))},{});throw new Error("react-localize-redux: Invalid key passed to getTranslate.")}})},function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.localize=void 0;var r=n(1),a=(function(e){e&&e.__esModule}(r),n(8)),o=n(0),u=function(e){return function(t){var n=e?t[e]:t;return{currentLanguage:(0,o.getActiveLanguage)(n).code,translate:(0,o.getTranslate)(n)}}};t.localize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(0,a.connect)(u(t))(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"localize",{enumerable:!0,get:function(){return r.localize}});var a=n(0);Object.defineProperty(t,"localeReducer",{enumerable:!0,get:function(){return a.localeReducer}}),Object.defineProperty(t,"initialize",{enumerable:!0,get:function(){return a.initialize}}),Object.defineProperty(t,"addTranslation",{enumerable:!0,get:function(){return a.addTranslation}}),Object.defineProperty(t,"addTranslationForLanguage",{enumerable:!0,get:function(){return a.addTranslationForLanguage}}),Object.defineProperty(t,"setLanguages",{enumerable:!0,get:function(){return a.setLanguages}}),Object.defineProperty(t,"setActiveLanguage",{enumerable:!0,get:function(){return a.setActiveLanguage}}),Object.defineProperty(t,"getTranslate",{enumerable:!0,get:function(){return a.getTranslate}}),Object.defineProperty(t,"getActiveLanguage",{enumerable:!0,get:function(){return a.getActiveLanguage}}),Object.defineProperty(t,"getLanguages",{enumerable:!0,get:function(){return a.getLanguages}}),Object.defineProperty(t,"getTranslations",{enumerable:!0,get:function(){return a.getTranslations}}),Object.defineProperty(t,"getOptions",{enumerable:!0,get:function(){return a.getOptions}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateOptions=t.objectValuesToString=t.getIndexForLanguageCode=t.templater=t.hasHtmlTags=t.getLocalizedElement=void 0;var r=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0),u=(t.getLocalizedElement=function(e,t,n,r){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:o.defaultTranslateOptions,l=t[e]||function(){return c.missingTranslationCallback&&c.missingTranslationCallback(e,r.code),c.showMissingTranslationMsg?"Missing localized key: "+e+" for language: "+r.code:""}(),s=i(l,n);return c.renderInnerHtml&&u(s)?a.default.createElement("span",{dangerouslySetInnerHTML:{__html:s}}):s},t.hasHtmlTags=function(e){var t=/(&[^\s]*;|<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[\^'">\s]+))?)+\s*|\s*)\/?>)/;return e.search(t)>=0}),i=t.templater=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t){var r="\\${\\s*"+n+"\\s*}",a=new RegExp(r,"gmi");e=e.replace(a,t[n])}return e};t.getIndexForLanguageCode=function(e,t){return t.map(function(e){return e.code}).indexOf(e)},t.objectValuesToString=function(e){return Object.values?Object.values(e).toString():Object.keys(e).map(function(t){return e[t].toString()}).toString()},t.validateOptions=function(e){if(void 0!==e.translationTransform&&"function"!=typeof e.translationTransform)throw new Error("react-localize-redux: Invalid translationTransform function.");return e}},function(e,t,n){function r(e,t){function n(e,i,c){c=c||1,Object.keys(e).forEach(function(l){var s=e[l],f=t.safe&&Array.isArray(s),g=Object.prototype.toString.call(s),d=o(s),p="[object Object]"===g||"[object Array]"===g,v=i?i+r+l:l;if(!f&&!d&&p&&Object.keys(s).length&&(!t.maxDepth||c<a))return n(s,v,c+1);u[v]=s})}t=t||{};var r=t.delimiter||".",a=t.maxDepth,u={};return n(e),u}function a(e,t){function n(e){var t=Number(e);return isNaN(t)||-1!==e.indexOf(".")?e:t}t=t||{};var r=t.delimiter||".",u=t.overwrite||!1,i={};return o(e)||"[object Object]"!==Object.prototype.toString.call(e)?e:(Object.keys(e).forEach(function(o){for(var c=o.split(r),l=n(c.shift()),s=n(c[0]),f=i;void 0!==s;){var g=Object.prototype.toString.call(f[l]),d="[object Object]"===g||"[object Array]"===g;if(!u&&!d&&void 0!==f[l])return;(u&&!d||!u&&null==f[l])&&(f[l]="number"!=typeof s||t.object?{}:[]),f=f[l],c.length>0&&(l=n(c.shift()),s=n(c[0]))}f[l]=a(e[o],t)}),i)}var o=n(6);e.exports=r;r.flatten=r,r.unflatten=a},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function r(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}/*! | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-redux"),require("redux")):"function"==typeof define&&define.amd?define(["react","react-redux","redux"],t):"object"==typeof exports?exports.ReactLocalizeRedux=t(require("react"),require("react-redux"),require("redux")):e.ReactLocalizeRedux=t(e.React,e.ReactRedux,e.Redux)}(this,function(e,t,n){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];switch(t.type){case f:case p:var n=t.payload.options||{},r=t.payload.activeLanguage||n.defaultLanguage;return t.payload.languages.map(function(e,t){var n=function(e){return void 0!==r?e===r:0===t};return"string"==typeof e?{code:e,active:n(e)}:i({},e,{active:n(e.code)})});case v:return e.map(function(e){return e.code===t.payload.languageCode?i({},e,{active:!0}):i({},e,{active:!1})});default:return e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case g:var n=void 0!==t.translationTransform?t.translationTransform(t.payload.translation,t.languageCodes):t.payload.translation;return i({},e,(0,c.flatten)(n,{safe:!0}));case d:var a=t.languageCodes.indexOf(t.payload.language),o=a>=0?(0,c.flatten)(t.payload.translation):{},u=Object.keys(o).reduce(function(n,u){var c=t.languageCodes.map(function(t,n){var r=e[u]||[];return n===a?o[u]:r[n]});return i({},n,r({},u,c))},{});return i({},e,u);default:return e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments[1];switch(t.type){case f:var n=t.payload.options||{};return i({},e,(0,s.validateOptions)(n));default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getTranslate=t.getTranslationsForActiveLanguage=t.translationsEqualSelector=t.getActiveLanguage=t.getOptions=t.getLanguages=t.getTranslations=t.setActiveLanguage=t.setLanguages=t.addTranslationForLanguage=t.addTranslation=t.initialize=t.localeReducer=t.defaultTranslateOptions=t.TRANSLATE=t.SET_ACTIVE_LANGUAGE=t.SET_LANGUAGES=t.ADD_TRANSLATION_FOR_LANGUGE=t.ADD_TRANSLATION=t.INITIALIZE=void 0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.languages=a,t.translations=o,t.options=u;var c=(n(9),n(5)),l=n(7),s=n(4),f=t.INITIALIZE="@@localize/INITIALIZE",g=t.ADD_TRANSLATION="@@localize/ADD_TRANSLATION",d=t.ADD_TRANSLATION_FOR_LANGUGE="@@localize/ADD_TRANSLATION_FOR_LANGUGE",p=t.SET_LANGUAGES="@@localize/SET_LANGUAGES",v=t.SET_ACTIVE_LANGUAGE="@@localize/SET_ACTIVE_LANGUAGE",y=(t.TRANSLATE="@@localize/TRANSLATE",t.defaultTranslateOptions={renderInnerHtml:!0,showMissingTranslationMsg:!0}),b={languages:[],translations:{},options:y},T=(t.localeReducer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t=arguments[1],n=e.languages.map(function(e){return e.code}),r=e.options.translationTransform;return{languages:a(e.languages,t),translations:o(e.translations,i({},t,{languageCodes:n,translationTransform:r})),options:u(e.options,t)}},t.initialize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y;return{type:f,payload:{languages:e,options:t}}},t.addTranslation=function(e){return{type:g,payload:{translation:e}}},t.addTranslationForLanguage=function(e,t){return{type:d,payload:{translation:e,language:t}}},t.setLanguages=function(e,t){return{type:p,payload:{languages:e,activeLanguage:t}}},t.setActiveLanguage=function(e){return{type:v,payload:{languageCode:e}}},t.getTranslations=function(e){return e.translations}),A=t.getLanguages=function(e){return e.languages},O=t.getOptions=function(e){return e.options},m=t.getActiveLanguage=function(e){return A(e).filter(function(e){return!0===e.active})[0]},L=t.translationsEqualSelector=(0,l.createSelectorCreator)(l.defaultMemoize,function(e,t){if(!(Array.isArray(e)||"code,active"===Object.keys(e).toString())){var n=t,r=e,a=Object.keys(n).toString(),o=Object.keys(r).toString();return a+" - "+(0,s.objectValuesToString)(n)==o+" - "+(0,s.objectValuesToString)(r)}return t===e}),j=t.getTranslationsForActiveLanguage=L(m,A,T,function(e,t,n){var a=e.code,o=(0,s.getIndexForLanguageCode)(a,t);return Object.keys(n).reduce(function(e,t){return i({},e,r({},t,n[t][o]))},{})});t.getTranslate=(0,l.createSelector)(j,m,O,function(e,t,n){return function(a){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=i({},n,u);if("string"==typeof a)return(0,s.getLocalizedElement)(a,e,o,t,c);if(Array.isArray(a))return a.reduce(function(n,a){return i({},n,r({},a,(0,s.getLocalizedElement)(a,e,o,t,c)))},{});throw new Error("react-localize-redux: Invalid key passed to getTranslate.")}})},function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.localize=void 0;var r=n(1),a=(function(e){e&&e.__esModule}(r),n(8)),o=n(0),u=function(e){return function(t){var n=e?t[e]:t;return{currentLanguage:(0,o.getActiveLanguage)(n).code,translate:(0,o.getTranslate)(n)}}};t.localize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(0,a.connect)(u(t))(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"localize",{enumerable:!0,get:function(){return r.localize}});var a=n(0);Object.defineProperty(t,"localeReducer",{enumerable:!0,get:function(){return a.localeReducer}}),Object.defineProperty(t,"initialize",{enumerable:!0,get:function(){return a.initialize}}),Object.defineProperty(t,"addTranslation",{enumerable:!0,get:function(){return a.addTranslation}}),Object.defineProperty(t,"addTranslationForLanguage",{enumerable:!0,get:function(){return a.addTranslationForLanguage}}),Object.defineProperty(t,"setLanguages",{enumerable:!0,get:function(){return a.setLanguages}}),Object.defineProperty(t,"setActiveLanguage",{enumerable:!0,get:function(){return a.setActiveLanguage}}),Object.defineProperty(t,"getTranslate",{enumerable:!0,get:function(){return a.getTranslate}}),Object.defineProperty(t,"getActiveLanguage",{enumerable:!0,get:function(){return a.getActiveLanguage}}),Object.defineProperty(t,"getLanguages",{enumerable:!0,get:function(){return a.getLanguages}}),Object.defineProperty(t,"getTranslations",{enumerable:!0,get:function(){return a.getTranslations}}),Object.defineProperty(t,"getOptions",{enumerable:!0,get:function(){return a.getOptions}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateOptions=t.objectValuesToString=t.getIndexForLanguageCode=t.templater=t.hasHtmlTags=t.getLocalizedElement=void 0;var r=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0),u=(t.getLocalizedElement=function(e,t,n,r){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:o.defaultTranslateOptions,l=t[e]||function(){return c.missingTranslationCallback&&c.missingTranslationCallback(e,r.code),c.showMissingTranslationMsg?"Missing localized key: "+e+" for language: "+r.code:""}(),s=i(l,n);return c.renderInnerHtml&&u(s)?a.default.createElement("span",{dangerouslySetInnerHTML:{__html:s}}):s},t.hasHtmlTags=function(e){var t=/(&[^\s]*;|<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[\^'">\s]+))?)+\s*|\s*)\/?>)/;return e.search(t)>=0}),i=t.templater=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t){var r="\\${\\s*"+n+"\\s*}",a=new RegExp(r,"gmi");e=e.replace(a,t[n])}return e};t.getIndexForLanguageCode=function(e,t){return t.map(function(e){return e.code}).indexOf(e)},t.objectValuesToString=function(e){return Object.values?Object.values(e).toString():Object.keys(e).map(function(t){return e[t].toString()}).toString()},t.validateOptions=function(e){if(void 0!==e.translationTransform&&"function"!=typeof e.translationTransform)throw new Error("react-localize-redux: Invalid translationTransform function.");return e}},function(e,t,n){function r(e,t){function n(e,i,c){c=c||1,Object.keys(e).forEach(function(l){var s=e[l],f=t.safe&&Array.isArray(s),g=Object.prototype.toString.call(s),d=o(s),p="[object Object]"===g||"[object Array]"===g,v=i?i+r+l:l;if(!f&&!d&&p&&Object.keys(s).length&&(!t.maxDepth||c<a))return n(s,v,c+1);u[v]=s})}t=t||{};var r=t.delimiter||".",a=t.maxDepth,u={};return n(e),u}function a(e,t){function n(e){var t=Number(e);return isNaN(t)||-1!==e.indexOf(".")?e:t}t=t||{};var r=t.delimiter||".",u=t.overwrite||!1,i={};return o(e)||"[object Object]"!==Object.prototype.toString.call(e)?e:(Object.keys(e).forEach(function(o){for(var c=o.split(r),l=n(c.shift()),s=n(c[0]),f=i;void 0!==s;){var g=Object.prototype.toString.call(f[l]),d="[object Object]"===g||"[object Array]"===g;if(!u&&!d&&void 0!==f[l])return;(u&&!d||!u&&null==f[l])&&(f[l]="number"!=typeof s||t.object?{}:[]),f=f[l],c.length>0&&(l=n(c.shift()),s=n(c[0]))}f[l]=a(e[o],t)}),i)}var o=n(6);e.exports=r;r.flatten=r,r.unflatten=a},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function r(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}/*! | ||
* Determine if an object is a Buffer | ||
* | ||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> | ||
* @author Feross Aboukhadijeh <https://feross.org> | ||
* @license MIT | ||
*/ | ||
e.exports=function(e){return null!=e&&(n(e)||r(e)||!!e._isBuffer)}},function(e,t,n){"use strict";function r(e,t){return e===t}function a(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,a=0;a<r;a++)if(!e(t[a],n[a]))return!1;return!0}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=null,o=null;return function(){return a(t,n,arguments)||(o=e.apply(null,arguments)),n=arguments,o}}function u(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var n=t.map(function(e){return typeof e}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function i(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),a=0;a<t;a++)r[a]=arguments[a];var i=0,c=r.pop(),l=u(r),s=e.apply(void 0,[function(){return i++,c.apply(null,arguments)}].concat(n)),f=o(function(){for(var e=[],t=l.length,n=0;n<t;n++)e.push(l[n].apply(null,arguments));return s.apply(null,e)});return f.resultFunc=c,f.recomputations=function(){return i},f.resetRecomputations=function(){return i=0},f}}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t,r){return e[n[r]]=t,e},{})})}t.__esModule=!0,t.defaultMemoize=o,t.createSelectorCreator=i,t.createStructuredSelector=c;var l=t.createSelector=i(o)},function(e,n){e.exports=t},function(e,t){e.exports=n}])}); |
@@ -123,3 +123,3 @@ import { ReactElement } from 'react'; | ||
export function initialize(languages: string[]|NamedLanguage[], options: Options): InitializeAction; | ||
export function initialize(languages: Array<string|NamedLanguage>, options?: Options): InitializeAction; | ||
@@ -130,3 +130,3 @@ export function addTranslation(translation: MultipleLanguageTranslation): AddTranslationAction; | ||
export function setLanguages(languages: string[]|NamedLanguage[], activeLanguage: string): SetLanguagesAction; | ||
export function setLanguages(languages: Array<string|NamedLanguage>, activeLanguage?: string): SetLanguagesAction; | ||
@@ -133,0 +133,0 @@ export function setActiveLanguage(languageCode: string): SetActiveLanguageAction; |
@@ -1,8 +0,3 @@ | ||
export { localize } from './containers/Localize'; | ||
export { localize } from './Localize'; | ||
/** | ||
* TYPES | ||
*/ | ||
export { localeReducer, initialize, addTranslation, addTranslationForLanguage, setLanguages, setActiveLanguage, getTranslate, getActiveLanguage, getLanguages, getTranslations, getOptions } from './modules/locale'; | ||
export { localeReducer, initialize, addTranslation, addTranslationForLanguage, setLanguages, setActiveLanguage, getTranslate, getActiveLanguage, getLanguages, getTranslations, getOptions } from './locale'; |
import React from 'react'; | ||
import { defaultTranslateOptions } from './modules/locale'; | ||
import { defaultTranslateOptions } from './locale'; | ||
@@ -4,0 +4,0 @@ |
@@ -123,3 +123,3 @@ import { ReactElement } from 'react'; | ||
export function initialize(languages: string[]|NamedLanguage[], options: Options): InitializeAction; | ||
export function initialize(languages: Array<string|NamedLanguage>, options?: Options): InitializeAction; | ||
@@ -130,3 +130,3 @@ export function addTranslation(translation: MultipleLanguageTranslation): AddTranslationAction; | ||
export function setLanguages(languages: string[]|NamedLanguage[], activeLanguage: string): SetLanguagesAction; | ||
export function setLanguages(languages: Array<string|NamedLanguage>, activeLanguage?: string): SetLanguagesAction; | ||
@@ -133,0 +133,0 @@ export function setActiveLanguage(languageCode: string): SetActiveLanguageAction; |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _Localize = require('./containers/Localize'); | ||
var _Localize = require('./Localize'); | ||
@@ -17,3 +17,3 @@ Object.defineProperty(exports, 'localize', { | ||
var _locale = require('./modules/locale'); | ||
var _locale = require('./locale'); | ||
@@ -20,0 +20,0 @@ Object.defineProperty(exports, 'localeReducer', { |
@@ -12,3 +12,3 @@ 'use strict'; | ||
var _locale = require('./modules/locale'); | ||
var _locale = require('./locale'); | ||
@@ -15,0 +15,0 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
{ | ||
"name": "react-localize-redux", | ||
"version": "2.13.4", | ||
"version": "2.13.5", | ||
"description": "Localization library for React/Redux", | ||
@@ -16,3 +16,3 @@ "main": "./lib/index.js", | ||
"scripts": { | ||
"build": "npm run build:commonjs && npm run build:es && npm run build:flow && npm run build:umd && npm run build:umd:min && npm run copy:ts", | ||
"build": "npm run build:commonjs && npm run build:es && npm run copy:flow && npm run build:umd && npm run build:umd:min && npm run copy:ts", | ||
"build:commonjs": "rimraf lib && cross-env BABEL_ENV=commonjs babel ./src -d lib", | ||
@@ -22,3 +22,3 @@ "build:es": "rimraf es && cross-env BABEL_ENV=es babel ./src -d es", | ||
"build:umd:min": "webpack --env.prod --output-filename dist/ReactLocalizeRedux.min.js", | ||
"build:flow": "flow-copy-source ./src lib && flow-copy-source ./src es", | ||
"copy:flow": "ncp ./src/index.js.flow ./lib/index.js.flow && ncp ./src/index.js.flow ./es/index.js.flow", | ||
"copy:ts": "ncp ./src/index.d.ts ./lib/index.d.ts && ncp ./src/index.d.ts ./es/index.d.ts", | ||
@@ -25,0 +25,0 @@ "coverage": "jest --coverage", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1548
88638
18