{"id":18513149,"url":"https://github.com/yeojz/redux-intl-react","last_synced_at":"2025-04-09T06:32:46.291Z","repository":{"id":57350886,"uuid":"83300388","full_name":"yeojz/redux-intl-react","owner":"yeojz","description":"React bindings for localization with ICU MessageFormat using redux-intl-connect","archived":false,"fork":false,"pushed_at":"2018-04-13T16:40:33.000Z","size":96,"stargazers_count":1,"open_issues_count":8,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T00:10:03.664Z","etag":null,"topics":["i18n","internationalization","localization","react","redux"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yeojz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-27T10:57:41.000Z","updated_at":"2017-12-27T10:38:14.000Z","dependencies_parsed_at":"2022-09-16T21:11:44.018Z","dependency_job_id":null,"html_url":"https://github.com/yeojz/redux-intl-react","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fredux-intl-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fredux-intl-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fredux-intl-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fredux-intl-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeojz","download_url":"https://codeload.github.com/yeojz/redux-intl-react/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247992864,"owners_count":21029989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i18n","internationalization","localization","react","redux"],"created_at":"2024-11-06T15:36:39.700Z","updated_at":"2025-04-09T06:32:43.080Z","avatar_url":"https://github.com/yeojz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redux-intl-react\n\nReact bindings for localization with MessageFormat and optional ECMA Intl support using redux-intl-connect.\n\n[![Build Status][build-badge]][build-link]\n[![Coverage Status][coveralls-badge]][coveralls-link]\n[![npm package][npm-badge]][npm-link]\n[![PRs Welcome][pr-welcome-badge]][pr-welcome-link]\n\n## PSA\nIf you're looking to support [react-intl](https://github.com/yahoo/react-intl) in redux, please use [react-intl-redux](https://github.com/ratson/react-intl-redux) instead.\n\nThe main difference between this library and the aforementioned is that this does not depend on the availability of ECMA Intl or it's polyfill.\n\n## About\n`redux-intl-react` provides React specific bindings for localization using [redux-intl-connect](https://www.github.com/yeojz/redux-intl-connect) with [MessageFormat](http://userguide.icu-project.org/formatparse/messages) support.\n\n\nBasic functionality **does not** require browser support or polyfill for [ECMA-Intl](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Intl). Should you require those, you can enable it. By setting `ecmaSupport` to `true` in the reducer.\n\n## Installation\n\nInstall the library:\n\n```\nnpm install redux-intl-react redux react --save\n```\n\n## Usage\n\n```js\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport {Provider, FormattedMessage} from 'redux-intl-react'\nimport store from '\u003cproject-path\u003e/store'\n\nconst App = () =\u003e (\n  \u003cProvider store={store}\u003e\n    \u003cFormattedMessage id='translation_id' /\u003e\n  \u003c/Provider\u003e\n);\n\nReactDOM.render(\u003cApp /\u003e, document.getElementById('container'));\n```\n\n## Alias methods\n\nBoth `updateIntl` and `intlReducer` are aliased in this library. As such, you can do the following:\n\n```js\nimport {updateIntl, intlReducer} from 'redux-intl-react';\n```\n\ninstead of\n\n```js\nimport {updateIntl, intlReducer} from 'redux-intl-connect';\n```\n\nFor usage instructions, please refer to the [README](https://github.com/yeojz/redux-intl-connect/blob/master/README.md#available-methods) of `redux-intl-connect`\n\n\n## Convenience methods\n\nThis library provides some components for convenince. These are essentially Higher Order Functions over `react-redux`;\n\n### connect vs Redux connect\n\nInstead of doing the following:\n\n```js\nimport {injectIntl} from 'redux-intl-react';\nimport connect from 'react-redux';\n\nconst Component = (props) =\u003e (\n\t...code\n);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(injectIntl(Component));\n```\n\nyou can do this instead:\n\n```js\nimport {connect} from 'redux-intl-react';\n\nconst Component = (props) =\u003e (\n\t...code\n);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Component);\n```\n\n\n### Provider vs IntlProvider\n\n`Provider` is just a convenient wrapper for use if you are using `react-redux` provider as your root.\n\nIn the event that you already have a custom provider in use that already wraps the redux provider, you can use IntlProvider instead.\n\n```js\nimport React from 'react';\nimport {IntlProvider} from 'redux-intl-react';\nimport {Provider} from 'SOME_SPECIAL_PROVIDER';\n\nconst App = () =\u003e (\n  \u003cProvider store={store}\u003e\n    \u003cIntlProvider\u003e\n      \u003cApp /\u003e\n    \u003c/IntlProvider\u003e\n  \u003c/Provider\u003e\n);\n```\n\n## License\n\n`redux-intl-react` is [BSD licensed](./LICENSE)\n\n## See also\n\n-   [redux-intl-connect](https://www.github.com/yeojz/redux-intl-connect)\n\n## Acknowledgement\n\nHighly influenced by the following libraries:\n\n-   [react-intl](https://github.com/yahoo/react-intl)\n-   [react-intl-redux](https://github.com/ratson/react-intl-redux)\n\n\n[npm-badge]: https://img.shields.io/npm/v/redux-intl-react.svg?style=flat-square\n[npm-link]: https://www.npmjs.com/package/redux-intl-react\n\n[build-badge]: https://img.shields.io/circleci/project/github/yeojz/redux-intl-react/master.svg?style=flat-square\n[build-link]: https://circleci.com/gh/yeojz/redux-intl-react.svg\n\n[coveralls-badge]: https://img.shields.io/coveralls/yeojz/redux-intl-react.svg?style=flat-square\n[coveralls-link]: https://coveralls.io/github/yeojz/redux-intl-react\n\n[pr-welcome-badge]: https://img.shields.io/badge/PRs-Welcome-ff69b4.svg?style=flat-square\n[pr-welcome-link]: https://github.com/yeojz/redux-intl-react/blob/master/CONTRIBUTING.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeojz%2Fredux-intl-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeojz%2Fredux-intl-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeojz%2Fredux-intl-react/lists"}