{"_id":"@alvarium/react-redux-i18n","_rev":"9-e7d2bdb464a1ba800ac3ed59dcfc2b91","name":"@alvarium/react-redux-i18n","dist-tags":{"latest":"1.9.4"},"versions":{"1.9.2":{"name":"@alvarium/react-redux-i18n","version":"1.9.2","author":{"name":"Convious"},"main":"./build/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","lint":"esw --ext .js src --color","lint:watch":"npm run lint -- --watch","lint:fix":"npm run lint -- --fix","clean":"rimraf build","build":"npm run lint && babel src -d build","prepublish":"npm run clean && npm run build"},"babel":{"presets":["react","es2015","stage-0"]},"files":["build"],"repository":{"type":"git","url":"git://github.com/zoover/react-redux-i18n.git"},"dependencies":{"react-i18nify-lite":"^1.0.0"},"devDependencies":{"babel-cli":"^6.22.2","babel-eslint":"^7.1.1","babel-preset-es2015":"^6.22.0","babel-preset-react":"^6.22.0","babel-preset-stage-0":"^6.22.0","eslint":"^3.15.0","eslint-config-airbnb":"^14.1.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jsx-a11y":"^4.0.0","eslint-plugin-react":"^6.9.0","eslint-watch":"^2.1.14","rimraf":"^2.5.4"},"eslintConfig":{"parser":"babel-eslint","parserOptions":{"ecmaVersion":6,"sourceType":"module","ecmaFeatures":{"jsx":true,"impliedStrict":true}},"env":{"browser":true,"es6":true},"globals":{"moment":false,"intl":false,"global":false},"plugins":["react"],"extends":"airbnb","rules":{"arrow-parens":"off"}},"gitHead":"5a3f3d452b79d19f6f643ce7bd44ea0dc23d73b5","description":"A binding library for redux to react-i18nify","bugs":{"url":"https://github.com/zoover/react-redux-i18n/issues"},"homepage":"https://github.com/zoover/react-redux-i18n#readme","_id":"@alvarium/react-redux-i18n@1.9.2","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"elboletaire","email":"elboletaire@underave.net"},"dist":{"integrity":"sha512-GrqBh9F78NrYnzj16Yx1rgbRzowqKnGI9LG2KsAiyE/7p6L84rDnrnfrGvvu3GnZoKOeZDAAHDb3USwnMfvfpg==","shasum":"c5a8ff46e343b395b0773b4bdd19f40f3aa688cb","tarball":"https://registry.npmjs.org/@alvarium/react-redux-i18n/-/react-redux-i18n-1.9.2.tgz","fileCount":6,"unpackedSize":11418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbC+r9CRA9TVsSAnZWagAAaRMP/1O0ziAgTsw5soZHpfsn\n/Are+PYXO2vhBAQCJSLMVYs2AfKBkmf0Xgd/Ua03fiyZdHhkuiDlnDN5i4af\nv54VDBG9SoGRD9ci/9/oLeW62jsD7eUF8u8+c6mueaqKkkEB3PCHOeLB7Sz8\no6mw9sKwqko+ER6870JD6d/uegkLk9UyVjqKc9TMOwJY3zZgi0jENPGFRZ7k\nDvB/d6ZXL5/ng8Ncijx70MTmYCj30jU/hQTKywsyT4n1eYwQC3Jjhwgs5ScZ\nx4WHTBo7SBjjAUNoGGCqd3a/yTSgmk0h3GmOfRjiFKxP3yG3oeB+8OY6/GAa\nOXt7c4znSwSuuU2W35qRcJU/0G8LcNUW19ojNczosTDCsuOxwnYxpDJEQuOS\nW/bKK1WY/cM6n/jfkY1UnKmd7vKPWzZ5tFrmASPc5aJUhP7cllSB6loKYCus\nw5YFFEUVR4M3z5JA0TPKAqjks7H6iwSMZgGmvEr2RwKPz3M09+IkaThiv8U5\nwBtxcfmzqFleTMJtd6kPD/7d0/59Gfpn25OvLT5sJM40Nko3LkE/G7VNJ/an\nzEKB0PV9fBQVpbwi81Mg5DOsDFP2BVvf3aXmOG0klhTABxYYkhGjOALXfXID\nffxn+x15u7nvrXBn/0NkmdyYT7YFMDBPEsTf2EkO+bLi9E+x92ZJBkKbzus4\nZYit\r\n=Y2Kw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDnv9z7Q1XPH2ZWjBa1kXvb1dieu7okcAXTcqwa+fv3wQIfJGNChkWNGB6R5+7Zk3iANNafoNs0J0+gF7p2c11uqA=="}]},"maintainers":[{"name":"elboletaire","email":"elboletaire@underave.net"},{"name":"gtrias","email":"gtrias@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-redux-i18n_1.9.2_1527507708303_0.9171304440169228"},"_hasShrinkwrap":false},"1.9.3":{"name":"@alvarium/react-redux-i18n","version":"1.9.3","author":{"name":"Convious"},"main":"./build/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","lint":"esw --ext .js src --color","lint:watch":"npm run lint -- --watch","lint:fix":"npm run lint -- --fix","clean":"rimraf build","build":"npm run lint && babel src -d build","prepublish":"npm run clean && npm run build"},"babel":{"presets":["react","es2015","stage-0"]},"files":["build"],"repository":{"type":"git","url":"git://github.com/zoover/react-redux-i18n.git"},"dependencies":{"react-i18nify-lite":"^1.0.0"},"devDependencies":{"babel-cli":"^6.22.2","babel-eslint":"^7.1.1","babel-preset-es2015":"^6.22.0","babel-preset-react":"^6.22.0","babel-preset-stage-0":"^6.22.0","eslint":"^3.15.0","eslint-config-airbnb":"^14.1.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jsx-a11y":"^4.0.0","eslint-plugin-react":"^6.9.0","eslint-watch":"^2.1.14","rimraf":"^2.5.4"},"eslintConfig":{"parser":"babel-eslint","parserOptions":{"ecmaVersion":6,"sourceType":"module","ecmaFeatures":{"jsx":true,"impliedStrict":true}},"env":{"browser":true,"es6":true},"globals":{"moment":false,"intl":false,"global":false},"plugins":["react"],"extends":"airbnb","rules":{"arrow-parens":"off"}},"gitHead":"516fa6308cf874f0ac86fcb3e9ea13f0ab10081b","description":"A binding library for redux to react-i18nify","bugs":{"url":"https://github.com/zoover/react-redux-i18n/issues"},"homepage":"https://github.com/zoover/react-redux-i18n#readme","_id":"@alvarium/react-redux-i18n@1.9.3","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"elboletaire","email":"elboletaire@underave.net"},"dist":{"integrity":"sha512-CitYFV9sAYyprGZe3VGB6QRVsN3rST1gHGcOWzjSQl/y6WprL53BDAFl5tT77hxcYYXqNZNeuc9BJ1D689/Etw==","shasum":"e60ee6856b895ee341d46c7d3b389970f376ec44","tarball":"https://registry.npmjs.org/@alvarium/react-redux-i18n/-/react-redux-i18n-1.9.3.tgz","fileCount":6,"unpackedSize":11418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbC+tXCRA9TVsSAnZWagAAb+cP/RkQEYbv6T7YbGKsu+ah\nD03FCTwMmZB4fzXZonoAbicNi3v+H0zqPpNz9WW6Szl4CFrT1xfz7qrQMNwP\naBHaVCV2ioj9iymIrLy7w6liLY5T1ZU8o5fQhC7ahbLuQe+E9Gr6/JGxntS5\nl9yHNiDMTbdjLuD2iDcJqNM8Sw4yWjK2xJmfEEwQhRqnD9qiGzkNlTHEObrc\n66L/CRdF7eaI2ejiXO7oMcNUfPo28EZxpAUGpfgQn6hVPNCXniUcNeQI1dGt\ndOjXHhAkRZQ1CeK2lwVrYitCyL/N5C2Hh+qmqbkO4sQq8S793F04JK/126Bd\nrMJjjsiR7F5I37SbkGuhsT8T1bZMwyWHSqryCExLlZuH/4ZuBuNnlRO/SqR8\nfy+eEM6QhFSnC6WVkE0F/jE/lXn/eYJzCegBQS+iVqkkLKhlBlYao9ruu5df\n/dRtG+3UAMksskE93ciz+ty5Q5beVR9GQIH96omHlUEVJsVzHyVhFqF0oi3c\nZdLgSwO7ycXPf39dSgMAjRwQW+DCs0rX7zqbSlp6UH+DbZjtQfI66RRTEVq/\nh4BPNRAl1oB57ALU2EfxHezXqemJkoeUCBzvkMxSVG73/ept5W7I1BobkOtE\nzLElo/QMDoJVE0+LFYGxzgZwIwHkSBSc1d2LF46sOUMhg5713MIiO/azX8NR\n5y1u\r\n=55Xa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcSnOrwmNk81gPioIrHr1QcBeexwr1infgCnjaoB9iPwIhAO8HOXpv5zWicOjqX+o9upQ/0sk6HQWhp7Tj3Py1iLAn"}]},"maintainers":[{"name":"elboletaire","email":"elboletaire@underave.net"},{"name":"gtrias","email":"gtrias@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-redux-i18n_1.9.3_1527507798916_0.3949531587838573"},"_hasShrinkwrap":false},"1.9.4":{"name":"@alvarium/react-redux-i18n","version":"1.9.4","author":{"name":"Convious"},"main":"./build/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","lint":"esw --ext .js src --color","lint:watch":"npm run lint -- --watch","lint:fix":"npm run lint -- --fix","clean":"rimraf build","build":"npm run lint && babel src -d build","prepublish":"npm run clean && npm run build"},"babel":{"presets":["react","es2015","stage-0"]},"files":["build"],"repository":{"type":"git","url":"git://github.com/alvarium/react-redux-i18n.git"},"dependencies":{"react-i18nify-lite":"^1.0.0"},"devDependencies":{"babel-cli":"^6.22.2","babel-eslint":"^7.1.1","babel-preset-es2015":"^6.22.0","babel-preset-react":"^6.22.0","babel-preset-stage-0":"^6.22.0","eslint":"^3.15.0","eslint-config-airbnb":"^14.1.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jsx-a11y":"^4.0.0","eslint-plugin-react":"^6.9.0","eslint-watch":"^2.1.14","rimraf":"^2.5.4"},"eslintConfig":{"parser":"babel-eslint","parserOptions":{"ecmaVersion":6,"sourceType":"module","ecmaFeatures":{"jsx":true,"impliedStrict":true}},"env":{"browser":true,"es6":true},"globals":{"moment":false,"intl":false,"global":false},"plugins":["react"],"extends":"airbnb","rules":{"arrow-parens":"off"}},"gitHead":"5c0e4ef6a5f8c78720792f0603007b30c2eb8775","description":"A binding library for redux to react-i18nify","bugs":{"url":"https://github.com/alvarium/react-redux-i18n/issues"},"homepage":"https://github.com/alvarium/react-redux-i18n#readme","_id":"@alvarium/react-redux-i18n@1.9.4","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"elboletaire","email":"elboletaire@underave.net"},"dist":{"integrity":"sha512-bJSlD0rGDbgBvqga55yLvlQHFGo/eMkOBHSBTzhEUNYDBhVapSmB/ZxL03hSjT0UvT9S49bW5SFdsLc2hY7ytg==","shasum":"e9b8f0d928652babf3bca815350cb930f274cf35","tarball":"https://registry.npmjs.org/@alvarium/react-redux-i18n/-/react-redux-i18n-1.9.4.tgz","fileCount":6,"unpackedSize":11420,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbC+xvCRA9TVsSAnZWagAAD2EQAJy+mqcHqvR3zMOrlL4f\ntvRkdKifmg5mP5iOYQdkjxYM7LSMmqO5tHQXLtBC0MC45IOP7ttrNMj+Uom2\nS09QrvW1Yfs0XqgvPN5j46dk0Khiwfsjw0b6sXM4jYrLy7CWNnNbVkC8cm2W\ngNER1NKUTh1ihWeT4J6UdCfOnPl7116jP72QiEKT4VNlPhLNCGZREecKSwMx\ndviGaWesOm4JOPvB+igCSPL+DstCVJnSbZPi13nrAQg8XfAIE4Ku+fLDTcLT\nkIxx4aVhlpnvXFfdWYZyOicaGswb4bpHcZt3+tx4D1of3ssdb9UGeYd4aT8B\nfjeTxlowwd2fMcnt++wTJ2QCxgvyQOYprvKfkgVW3o8Cu0NZMv5BhSxMehOv\nRJyT2QtUgkfTsEezb571DQ4prywwT8ezDLzL+wHe0Ohg4VnrO7GNapeLxbnp\nePkavrXS2KWGrcZuB2yTVC5I5nDKeqQO7uWqsNYLnRJbwIY0OAzzzGZOZ6vI\nFbHGeYWr2tqXh9Vwtviw1bujdJ+OmJoG15hBWaN+eP6W4Fmg2XJ0EstXbLVL\ndBcKphGWI4TGNzXD0inL5Xz2y4Jr5ljWgvqegJ0UnVNqyM5u5mAz0g/922ZH\niJ0LbLeXTNYEu/LehRz88V4trMDj1EIrB/5fQ5d4m9NUAgp9nbOcENfe7qF0\nhhOM\r\n=kKSf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmfm63r4JxvdgZULnf3rn0iy6ReoLvbe1+V5ldZxnTIgIgPVc3WljHhexhoE+r6o3VjJFMjXO1jirsy3VuPRy43KE="}]},"maintainers":[{"name":"elboletaire","email":"elboletaire@underave.net"},{"name":"gtrias","email":"gtrias@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-redux-i18n_1.9.4_1527508079266_0.502418170395244"},"_hasShrinkwrap":false}},"time":{"created":"2018-05-28T11:41:48.169Z","1.9.2":"2018-05-28T11:41:48.447Z","modified":"2024-05-29T09:17:25.689Z","1.9.3":"2018-05-28T11:43:18.985Z","1.9.4":"2018-05-28T11:47:59.407Z"},"maintainers":[{"email":"lluc@cirici.com","name":"lluccirici"},{"email":"sandra@cirici.com","name":"sandravigo"},{"email":"x.castilla@cirici.com","name":"javco"},{"email":"ander.arce161@gmail.com","name":"alexanderarce"}],"description":"A binding library for redux to react-i18nify","homepage":"https://github.com/alvarium/react-redux-i18n#readme","repository":{"type":"git","url":"git://github.com/alvarium/react-redux-i18n.git"},"author":{"name":"Convious"},"bugs":{"url":"https://github.com/alvarium/react-redux-i18n/issues"},"readme":"# react-redux-i18n\n\nA binding library for redux to react-i18nify\n\n## Usage\n\nFirst install the package.\n\nUsing `npm`:\n```\nnpm i react-redux-i18n --save\n```\n\nUsing `yarn`:\n```\nyarn add react-redux-i18n\n```\n\n`redux-thunk` is an implicit dependency, so you need it installed and included in your project.\n\nTo learn more about `redux-thunk`, refer to it's GitHub page:\nhttps://github.com/gaearon/redux-thunk\n\nNext, load the translations to be used, for example in `app.js` or in your apps entry point:\n\n```javascript\nimport { createStore, combineReducers, applyMiddleware } from 'redux';\nimport thunk from 'redux-thunk';\nimport { loadTranslations, setLocale, syncTranslationWithStore, i18nReducer } from 'react-redux-i18n';\nimport reducers from './reducers';\n\nconst translationsObject = {\n  en: {\n    application: {\n      title: 'Awesome app with i18n!',\n      hello: 'Hello, %{name}!'\n    },\n    date: {\n      long: 'MMMM Do, YYYY'\n    },\n    export: 'Export %{count} items',\n    export_0: 'Nothing to export',\n    export_1: 'Export %{count} item',\n    two_lines: 'Line 1<br />Line 2',\n    literal_two_lines: 'Line 1\\\nLine 2'\n  },\n  nl: {\n    application: {\n      title: 'Toffe app met i18n!',\n      hello: 'Hallo, %{name}!'\n    },\n    date: {\n      long: 'D MMMM YYYY'\n    },\n    export: 'Exporteer %{count} dingen',\n    export_0: 'Niks te exporteren',\n    export_1: 'Exporteer %{count} ding',\n    two_lines: 'Regel 1<br />Regel 2',\n    literal_two_lines: 'Regel 1\\\nRegel 2'\n  }\n};\n\nconst store =  createStore(\n  combineReducers({\n    ...reducers,\n    i18n: i18nReducer\n  }),\n  applyMiddleware(thunk)\n);\nsyncTranslationWithStore(store)\nstore.dispatch(loadTranslations(translationsObject));\nstore.dispatch(setLocale('en'));\n\n```\n\n**NB!** Please note that reducer's name must be `i18n`! Make sure your project's reducers don't clash with it.\n\n\n## Components\n\nThe easiest way to translate or localize in your React components is by using the `Translate` and `Localize` components,\ndirectly exported from `react-i18nify` package:\n\n```javascript\nvar React = require('react');\nvar Translate = require('react-redux-i18n').Translate;\nvar Localize = require('react-redux-i18n').Localize;\n\nvar AwesomeComponent = React.createClass({\n  render: function() {\n    return (\n      <div>\n        <Translate value=\"application.title\"/>\n          // => returns '<span>Toffe app met i18n!</span>' for locale 'nl'\n        <Translate value=\"application.title\" style={{ fontWeight: 'bold', fontSize: '14px' }} />\n        // => returns '<span style=\"font-weight:bold;font-size:14px;\">Toffe app met i18n!</span>' for locale 'nl'\n        <Translate value=\"application.hello\" name=\"Aad\"/>\n          // => returns '<span>Hallo, Aad!</span>' for locale 'nl'\n        <Localize value=\"2015-09-03\" dateFormat=\"date.long\"/>\n          // => returns '<span>3 september 2015</span> for locale 'nl'\n        <Localize value={10/3} options={{style: 'currency', currency: 'EUR', minimumFractionDigits: 2, maximumFractionDigits: 2}}/>\n          // => returns '<span>€ 3,33</span> for locale 'nl'\n        <Translate value=\"export\" count={1} />\n          // => returns '<span>Exporteer 1 ding</span> for locale 'nl'\n        <Translate value=\"export\" count={2} />\n          // => returns '<span>Exporteer 2 dingen</span> for locale 'nl'\n        <Translate value=\"two_lines\" dangerousHTML />\n          // => returns '<span>Regel 1<br />Regel 2</span>'\n      </div>\n    );\n  }\n});\n```\n\n## Keeping components updated\n\nWhen the translation object or locale values are set, all instances of `Translate` and `Localize` will be re-rendered to\nreflect the latest state. If you choose to use `I18n.l` or `I18n.t` then it up to you to handle state change.\n\nIf you'd rather not to re-render components after setting locale or translations object, then pass `false` as a second\nargument to `setLocale` and/or `setTranslations`.\n\n## Helpers\n\nIf for some reason, you cannot use the components, you can use the `I18n.t` and `I18n.l` helpers instead:\n\n```javascript\nvar I18n = require('react-redux-i18n').I18n;\n\nI18n.t('application.title'); // => returns 'Toffe app met i18n!' for locale 'nl'\nI18n.t('application.hello', {name: 'Aad'}); // => returns 'Hallo, Aad!' for locale 'nl'\nI18n.t('export', {count: 0}); // => returns 'Niks te exporteren' for locale 'nl'\nI18n.t('application.weird_key'); // => returns 'Weird key' as translation is missing\nI18n.t('application', {name: 'Aad'}); // => returns {hello: \"Hallo, Aad!\", title: \"Toffe app met i18n!\"} for locale 'nl'\n\nI18n.l(1385856000000, { dateFormat: 'date.long' }); // => returns '1 december 2013' for locale 'nl'\nI18n.l(Math.PI, { maximumFractionDigits: 2 }); // => returns '3,14' for locale 'nl'\n```\n\n## Supported localize options\n\nThe localize component and helper support all date formatting options as provided by the Javascript `moment` library. For the full list of options, see http://momentjs.com/docs/#/displaying/format/.\n\nFor number formatting, the localize component and helper support all options as provided by the Javascript built-in `Intl.NumberFormat` object. For the full list of options, see https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat.\n\n[downloads-image]: http://img.shields.io/npm/dm/react-redux-i18n.svg\n\n[npm-url]: https://npmjs.org/package/react-redux-i18n\n[npm-image]: http://img.shields.io/npm/v/react-redux-i18n.svg\n","readmeFilename":"README.md"}