{"_id":"@artemisag/i18n-js-plus","_rev":"13-5281b0864e515b618ab754d1a83a04a3","name":"@artemisag/i18n-js-plus","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@artemisag/i18n-js-plus","version":"1.0.0","license":"MIT","_id":"@artemisag/i18n-js-plus@1.0.0","maintainers":[{"name":"sdelmont","email":"sd@notso.net"},{"name":"daashcraft","email":"daniel.ashcraft@ofashandfire.com"},{"name":"mjtribble","email":"mjtribble2@gmail.com"},{"name":"jondayton","email":"jondayton@gmail.com"},{"name":"justinm-nyc","email":"justinmartinelli1@gmail.com"},{"name":"jessicaepdx","email":"jessicaepdx@gmail.com"}],"homepage":"https://github.com/artemis-ag/i18n-js-plus#readme","bugs":{"url":"https://github.com/artemis-ag/i18n-js-plus/issues"},"dist":{"shasum":"a62f66c415aaf4a7d8cc704317972f6504154613","tarball":"https://registry.npmjs.org/@artemisag/i18n-js-plus/-/i18n-js-plus-1.0.0.tgz","fileCount":7,"integrity":"sha512-2Zahpxlrf8nyPhuw2N8GgUrJgYvTbXXXgy5nVTYX8TjN6Z7DCJxPuOsmOD+4jbItGWrgdyLY5xLSvr2ZJahQrw==","signatures":[{"sig":"MEYCIQCkdKfMDxoSvta3OqjG8951zOjQKBf7yNLhEqjS17RW/gIhAJzSk9DOYdlQ7a4WSS5AZDv2+ALYtg+91vBdqty8th7y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":166120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHQMsCRA9TVsSAnZWagAAx7oP/RYfA8jO50ngVySKs38c\nV587gt/KjuXG/2sMSXbsOjIhsKPGJTyYgfgZ0OHYFue3LmBUHct/85hkvepe\nGPUuYAfmtSce5P+g0t1b6FkyhIp0nhocTwaChqFzEwWNGRSaP/ZSwi/6ALfT\n0S678q2lTbMqfwZLBZR3IWDjQlqMqswEh1nDnZEXw6RVwL++8P5JVeyiBE3w\njTM7roRselinrnD6vR6cuWqAjE+ect2RTxQP/P5dcm89AauYYDDfGWhrZ1YC\nQvKA//AwIa5YSBRZE2hI9Tf7/j5j+9KlPH9qKbMxbQEZnIsjwxiJwt2dVbok\n78dEqwZNH/z4rv/QcJvhoc5I4Y2SNOuc9w861Thxvzxm+dCTNltYkNMa4/+U\nU5xBSco4OdRuVcpBLjp44uluQVwTibSJao38FMcWf8+LrSmqisTZGCEzx06P\nqanYNuC0UjN9p37mlZ1b3zoxdA+om/xFW/7RDoxwgsmJzTuNkJoJZpzeXAn6\nXsavpljTiGQuq5CXPyuFX5m27JTqjzxu6yRCp8V61ml6nrzY40u3KOPc3DIF\nu6yK7pTqZJukuRV0074RMVbFFkMJhdK2NHVkJ3xHMh/s7gfmhGUFdh0GPDx9\n7rCAD/CmNsjtjZGypihw3CMbUOCayr9a11qnUU9JElnO/4FUMJq6C/dtHSRs\nR4I+\r\n=m3qz\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"automock":false,"transform":{"^.+\\.js?$":"babel-jest"},"setupFiles":["./setupJest.js"],"testEnvironment":"jsdom","testPathIgnorePatterns":["/tests/fixtures/","/tests/support/","/dist/","/node_modules/","/rollup.config.js","/setupJest.js"]},"main":"dist/i18n-js-plus.cjs.js","module":"dist/i18n-js-plus.esm.js","gitHead":"6009e0d4258e3fb6f86a300fbb8b1a853d8b4912","scripts":{"lint":"eslint src spec","test":"jest --verbose","build":"rollup -c","watch":"rollup -c -w","test:ci":"jest spec --maxWorkers 2"},"_npmUser":{"name":"sdelmont","email":"sd@notso.net"},"repository":{"url":"git+ssh://git@github.com/artemis-ag/i18n-js-plus.git","type":"git"},"_npmVersion":"6.14.6","description":"This set of tools uses the `i18n-js` library and expands it to support react components and other features.","directories":{},"_nodeVersion":"12.18.4","dependencies":{"i18n-js":"^3.8"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.3","jsdom":"^16.0","react":"^16.8.6","enzyme":"^3.9.0","eslint":"^7.0","rollup":"^2.50.5","react-dom":"^16.8.6","@babel/core":"^7.14.3","rollup-jest":"^1.1.1","@babel/runtime":"^7.14.0","jest-fetch-mock":"^3.0","@babel/preset-env":"^7.14.4","eslint-plugin-node":"^11.1.0","@babel/preset-react":"^7.9.4","@rollup/plugin-json":"^4.0.0","eslint-plugin-react":"^7.24.0","@babel/eslint-parser":"^7.0.0","@rollup/plugin-babel":"^5.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-promise":"^5.1.0","eslint-config-standard":"^16.0.3","eslint-plugin-standard":"^5.0.0","@rollup/plugin-commonjs":"^20.0.0","enzyme-adapter-react-16":"^1.15.6","@rollup/plugin-node-resolve":"^13.0.0","@babel/plugin-transform-runtime":"^7.14.3","@babel/plugin-proposal-decorators":"^7.8.3","@babel/plugin-proposal-class-properties":"^7.8.3"},"_npmOperationalInternal":{"tmp":"tmp/i18n-js-plus_1.0.0_1629291308574_0.31920001964225597","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-08-18T12:55:08.505Z","modified":"2024-09-27T13:44:52.254Z","1.0.0":"2021-08-18T12:55:08.956Z"},"bugs":{"url":"https://github.com/artemis-ag/i18n-js-plus/issues"},"license":"MIT","homepage":"https://github.com/artemis-ag/i18n-js-plus#readme","repository":{"url":"git+ssh://git@github.com/artemis-ag/i18n-js-plus.git","type":"git"},"description":"This set of tools uses the `i18n-js` library and expands it to support react components and other features.","maintainers":[{"email":"software@iunu.com","name":"iunu-software"},{"email":"cmoreno@arkusnexus.com","name":"carlos.moreno357"},{"email":"jkircher@iunu.com","name":"jackiekircher"},{"email":"jondayton@gmail.com","name":"jondayton"}],"readme":"# Expanded Translation Tools for I18N-js\n\nThis set of tools uses the `i18n-js` library and expands it to support react components and other features.\n\nIt's main offerings are the `translate` function and the `Translate` react component. Both offer access to\ntranslation strings with multiple lookups, pluralization and interpolation.\n\n```\ntranslate(scope, { lookup, fallback, pluralFor, values  } )\n```\n\n```\n<Translate scope lookup fallback pluralFor values  />\n```\n\n## SIMPLE TRANSLATIONS\n\nA `scope` string references a specific value in the translation files managed by `i18n-js` for the current locale.\n\nThis string is a dot-separated list of names such as `example.messages.label` or `errors.access.not_allowed` that\nis used to search in the `locale` data managed by a rails application as YAML files inside `config/locale`.\n\n## PLURALIZATION\n\nIf `scope` matches a set of translations instead of a single string, keyed with `one`, `other` and `zero`, then the\nvalue of `pluralFor` is used to select the appropriate variation to pluralize that particular number.\n\nThe default value for `pluralFor` is `1` to make it easier to expand our translation trees.\nThis comes handy when we start with a simple scope such as `example.units.boards`, matched\nwith a translation value of `example.units.boards = 'Board'`.\nIf/when we decide we need another subscope, such as `example.units.boards.withQuantity`,\nwe can update the translation values so that `example.units.boards` becomes `example.units.boards.one`\nwithout having to change existing code that uses `example.units.boards` as a scope.\nOtherwise, adding subkeys to translation values at `example.units.boards` would cause errors.\n\n##  INTERPOLATION\n\nThe translation string matched by `scope` can include interpolation placeholders using `${name}` or `{{name}}`,\nwhich get replaced with the value for the given `name` included in `values`.\n\n## LOOKUP\n\nThe given `scope` can include placeholders using `[name]` --the scope, not the resulting translation string--\nwhich get replaced with values for the given `name` included in `lookup`. Values are also retrieved from the\n\"global translation lookups\" described below.\n\nThese values are \"normalized\" to use only underscores and lowercase alphanumeric characters.\n\nIf `name` corresponds to an array instead of a single value, then the `scope` will be used to search\nunder those possible values.\n\nThis means for example: a `scope` of `\"example.[type].[level].label\"`\nwith `lookup = {type: 'Name', level: ['Specific', 'Generic']}`\nwill search for translation strings under `example.name.specific.label` first,\nand if not found, under `example.name.generic.label`.\n\nIf a scope has multiple parts that map into arrays, all combinations will be searched.\n\nIf no matching string is found, then the optional `fallback` will be used instead.\n\n## LOCALE AND LOOKUP GLOBAL CONTEXT\n\nThe library provides a `setLocale` method to set the current locale (an identifier for language and\nregional variations such as `\"en-US\"` for American English or \"es\" for Spanish). There is also\na `getLocale` if you need to retrieve the current locale.\n\nYou can also define \"global translation lookup values\" with `addGlobalTranslationLookup(key, value)`\nand can be reset with `resetGlobalTranslationLookups()`.\n\nThese values are used along with explicit `lookup` values for all calls to `translate`.\n\n## CREDITS\n\nThis library was originally developed at [Artemis](https://artemisag.com/) by [Sebastián Delmont](https://github.com/sd).\n","readmeFilename":"README.md"}