{"_id":"@dokuhero/react-18n-ts-helper","_rev":"1-b89cd41ec7d8995751b18f20a8cc2d01","name":"@dokuhero/react-18n-ts-helper","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@dokuhero/react-18n-ts-helper","version":"0.0.1","description":"Set of helpers to work with https://github.com/i18next/react-i18next","main":"dist/index.js","typings":"typings/index.d.ts","scripts":{"lint":"tslint 'src/**/*.ts{,x}'","test":"echo \"Error: no test specified\" && exit 1","compile":"tsc -d --declarationDir ./typings","build":"rm -rf typings && rm -rf dist && npm run compile && prettier ./typings/**/*.d.ts --write"},"repository":{"type":"git","url":"git+https://github.com/dokuhero/react-18n-ts-helper.git"},"keywords":["react","i18n","translate"],"author":{"name":"Budi Adiono","email":"budiadiono@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/dokuhero/react-18n-ts-helper/issues"},"homepage":"https://github.com/dokuhero/react-18n-ts-helper#readme","devDependencies":{"@types/i18next":"^8.4.5","@types/react-i18next":"^7.8.2","i18next":"^11.8.0","prettier":"^1.14.2","react-i18next":"^7.12.0","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","tslint-react":"^3.6.0","typescript":"^3.0.3"},"peerDependencies":{"i18next":"*","react-i18next":"*"},"gitHead":"4ef754908fcdc526be2fc186424f9cb6441dfa19","_id":"@dokuhero/react-18n-ts-helper@0.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"budiadiono","email":"budiadiono@gmail.com"},"dist":{"integrity":"sha512-4ZtMK9LZiq6XD7b66w+DNgIk4McyPxK4bNWnjbrI6tG2HTTxqbkVsppDiseqan4BNAUc8L97Aw5dZpTJUJ2qWA==","shasum":"5dd35a682b7e3ee220430f42d3f9d24d2de8497d","tarball":"https://registry.npmjs.org/@dokuhero/react-18n-ts-helper/-/react-18n-ts-helper-0.0.1.tgz","fileCount":5,"unpackedSize":4052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmOEyCRA9TVsSAnZWagAA6IIQAKSyZMo40WmGm0reiSzc\nvbEu/cauUEx0pRHflhNj9DtzvJRipdkEJ/ln+8yaAoy/+sANTcbcsu7N9CcT\npO99lheuYUD2iQRNL3cvS0U9dJYImFIlXBcimXB+ejiQ19m8lutbzu0PYVL1\ngXjFFcBx5bjn1tJjyjYF0AvZMjkPTgkPikCgYAw3MW0SqP7Z/1hoxO/BWWRy\ne/FDUrRuwylo27DblHoY5pFgRXNh7gWunJABA6Zp/Ltdrx+eI1KfIfRUY3QH\nvQkMbsTlHqvg63xVDqYqEryQPOr9VkWOlvWhTyCqDIIMtNApPn7ZNx7fUllP\nFZ2NC+voqeeZ16eJcB9wna0tFbM5/YxNLYP4eU5tYIiCzsnqdgBs0gZz+6iL\ngxaPaQUetemXc25+aeomK4qNMmpVJQSt+SXl6FkEBj34mH4Pxnb9lY91e3GT\nnXYG4TLPqsY27x9/b8QSXdxyW861hQRar+S+SYf/yuarwWNmp6zdEmhcDTeb\nMisVpc2jZeF5JZAQUMNXRNLhACC4fd5Nfi9WBupyeeDVvr1BUclvNJvcGQIb\ngy4s9Tr9TQJ3p038BZd+VvzqnnMQVxiwepZTTxnjYs9r56GcEhkIN22ZLE3Y\nq8B7mKphgO87htAu6k4xvNbXSazWb0OZdEqDGkv2mCNx+p71UES/ZDGou+97\nZj/I\r\n=ZBip\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFYIyZEvx0ItPJpaA99uTE81arIkylwoKwIgujuzf9LTAiEAm5a66FRP7EdZ2VIYcQSC/F3Z+ProGBgTgAEJbMM6CkA="}]},"maintainers":[{"name":"budiadiono","email":"budiadiono@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-18n-ts-helper_0.0.1_1536745777839_0.09509408030532263"},"_hasShrinkwrap":false}},"time":{"created":"2018-09-12T09:49:37.681Z","0.0.1":"2018-09-12T09:49:37.950Z","modified":"2022-04-05T05:07:39.761Z"},"maintainers":[{"name":"budiadiono","email":"budiadiono@gmail.com"}],"description":"Set of helpers to work with https://github.com/i18next/react-i18next","homepage":"https://github.com/dokuhero/react-18n-ts-helper#readme","keywords":["react","i18n","translate"],"repository":{"type":"git","url":"git+https://github.com/dokuhero/react-18n-ts-helper.git"},"author":{"name":"Budi Adiono","email":"budiadiono@gmail.com"},"bugs":{"url":"https://github.com/dokuhero/react-18n-ts-helper/issues"},"license":"MIT","readme":"# React i18n Typescript Helper\r\n\r\nSet of helpers to work with [react-i18next](https://github.com/i18next/react-i18next) in Typescript.\r\n\r\n## Installation\r\n\r\nUsing npm:\r\n\r\n```\r\nnpm i -S @dokuhero/react-18n-ts-helper\r\n```\r\n\r\nor yarn:\r\n\r\n```\r\nyarn add @dokuhero/react-18n-ts-helper\r\n```\r\n\r\n## Usage\r\n\r\n### Translate HOC\r\n\r\n```typescript\r\nimport { withLocale } from '@dokuhero/react-18n-ts-helper'\r\n\r\ninterface TheComponentProps {\r\n  // ... your props\r\n}\r\n\r\nconst TheComponent = withLocale<TheComponentProps>('namespace')(({ t }) => (\r\n  <div>{t('say-hello')}</div>\r\n))\r\n```\r\n\r\n### Translate Class Decorator\r\n\r\n```typescript\r\nimport { withLocaleClass, WithLocaleProps } from '@dokuhero/react-18n-ts-helper'\r\n\r\ninterface TheComponentProps extends WithLocaleProps {\r\n  // ... your props\r\n}\r\n\r\n@withLocaleClass('common')\r\nclass TheComponent extends React.Component<TheComponentProps> {\r\n  render() {\r\n    const { t } = this.props\r\n    return <div>{t('say-hello')}</div>\r\n  }\r\n}\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}