{"_id":"@3cr/translations-ts","_rev":"1-108c2e30c12871797a8b8a8597b9cd38","name":"@3cr/translations-ts","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@3cr/translations-ts","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@3cr/translations-ts@1.0.0","maintainers":[{"name":"elliottcooper","email":"ecooper@singular.health"}],"homepage":"https://docs.3cr.singular.health","bugs":{"url":"https://bitbucket.org/medvr/3cr-translations-ts/issues"},"dist":{"shasum":"4ad77812df4c76181d61399f0029c8515e52e3ea","tarball":"https://registry.npmjs.org/@3cr/translations-ts/-/translations-ts-1.0.0.tgz","fileCount":15,"integrity":"sha512-9LFsKXbsd2U+Qp7Uzh9i14NerSZ4+y4VZqpijIdU6fLLVfZmlsMfxpJBeup6DQ6hY0fOFX3DQiIMovnvzdhWPw==","signatures":[{"sig":"MEUCICNhFCnCQ2dUy7oQgjeOdZXSMwkLSvS/3zrNbUcsxvGJAiEAtmFJ3d31T67/333W8Ts5rfSj/CcUx4NPAWmJuCyVgys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29675},"main":"index.js","gitHead":"a20518f63cc54cc0f28ad8cdb2b07cbbbe322d55","private":false,"scripts":{"build":"tsc","deploy":"npm run build && npm publish --access=public"},"_npmUser":{"name":"elliottcooper","email":"ecooper@singular.health"},"repository":{"url":"git+ssh://git@bitbucket.org/medvr/3cr-translations-ts.git","type":"git"},"_npmVersion":"10.2.4","description":"Translations for 3CR Status Codes","directories":{},"_nodeVersion":"21.5.0","dependencies":{"i18n-js":"^4.4.3","idb-keyval":"^6.2.1","@crowdin/ota-client":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.3","@types/node":"^20.11.30"},"_npmOperationalInternal":{"tmp":"tmp/translations-ts_1.0.0_1726565579159_0.9923100453480096","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@3cr/translations-ts","version":"1.0.1","description":"Translations for 3CR Status Codes","private":false,"main":"index.js","scripts":{"build":"tsc","deploy":"npm run build && npm publish --access=public"},"homepage":"https://docs.3cr.singular.health","repository":{"type":"git","url":"git+ssh://git@bitbucket.org/medvr/3cr-translations-ts.git"},"keywords":[],"author":"","license":"ISC","devDependencies":{"@types/node":"^20.11.30","typescript":"^5.4.3"},"dependencies":{"@crowdin/ota-client":"^2.0.0","i18n-js":"^4.4.3","idb-keyval":"^6.2.1"},"_id":"@3cr/translations-ts@1.0.1","gitHead":"6e8c9f202de6d4acea6fe356c64be756311f12ef","bugs":{"url":"https://bitbucket.org/medvr/3cr-translations-ts/issues"},"_nodeVersion":"21.5.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-CovDRyIs4fazPGORqDTI10etGP2Gp7lOQXNDHcBzO6xtNNqwf/YBkMP+tJyWwYzFLZREHvQWsrao4sjGHZYvnQ==","shasum":"a323d3048bb7915fda1707e231117075f94d7d61","tarball":"https://registry.npmjs.org/@3cr/translations-ts/-/translations-ts-1.0.1.tgz","fileCount":15,"unpackedSize":30176,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAoDd/OBonVSk+t2kc3RtFjt8Hq1Y7eGdxZBOn0mnBvWAiEA4taHmYBJcIwWyZ6W5cK3hVHceItIRti4Dh1vI0dIKMI="}]},"_npmUser":{"name":"elliottcooper","email":"ecooper@singular.health"},"directories":{},"maintainers":[{"name":"elliottcooper","email":"ecooper@singular.health"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/translations-ts_1.0.1_1726572317707_0.08878885207654696"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-17T09:32:59.050Z","modified":"2024-09-17T11:25:18.137Z","1.0.0":"2024-09-17T09:32:59.307Z","1.0.1":"2024-09-17T11:25:17.938Z"},"bugs":{"url":"https://bitbucket.org/medvr/3cr-translations-ts/issues"},"license":"ISC","homepage":"https://docs.3cr.singular.health","keywords":[],"repository":{"type":"git","url":"git+ssh://git@bitbucket.org/medvr/3cr-translations-ts.git"},"description":"Translations for 3CR Status Codes","maintainers":[{"name":"elliottcooper","email":"ecooper@singular.health"}],"readme":"# @3cr/translations-ts\n\n![](https://img.shields.io/badge/tests-successful-green)\n![](https://img.shields.io/circleci/build/bitbucket/medvr/3cr-sdk-browser/main)\n\n\nEcosystem integration for code translations for [3DICOM Core Renderer (3CR)](https://docs.3cr.singular.health/) within the Browser (client-side)\n\n## Install `@3cr/translations-ts` package\n\nUse the package manager [npm](https://www.npmjs.com/package/npm) or [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) to install `@3cr/translations-ts`\n\n\nnpm\n```bash\nnpm install @3cr/translations-ts\n```\nyarn\n```bash\nyarn add @3cr/translations-ts\n```\n\n\n## Using the Package\n\n1. #### Retrieve available Languages\n\n    Call the `getAvailableLanguages` function to retrieve a list of ISO-639 Language Codes that this project supports\n\n    `Typescript (.ts)`\n    ```ts\n    import {\n      getAvailableLanguages\n    } from \"@3cr/translations-ts\";\n    \n    const languages: Array<string> = await getAvailableLanguages();\n    ```\n2. #### Set your language\n\n    Call `setLanguage` with an ISO-639 Language Code you derived from the previous step\n\n    `Typescript (.ts)`\n    ```ts\n    import {\n      setLanguage\n    } from \"@3cr/translations-ts\";\n    \n    await setLanguage(languages[0]); // 'en' in this case\n    ```\n\n3. #### Translate your code\n\n    Call `t` and supply the code you wish to translate.\n\n    `Typescript (.ts)`\n    ```ts\n    import {\n      t\n    } from \"@3cr/translations-ts\";\n    \n    const translation = t('F00004');\n   \n    console.log(translation)\n    // \"Unable to load scan due to its dimensions exceeding 2048 pixels.\"\n\n    ```\n   \n   Note: For codes that have dynamic parameter mapping, you will need to supply a key-map for what to resolve the parameters to:\n\n   `Typescript (.ts)`\n    ```ts\n    import {\n      t\n    } from \"@3cr/translations-ts\";\n    \n    const translation = t('F00027', {ID: 'Some ID'});\n   \n    console.log(translation)\n    // \"Object with Id, Some ID, could not be found.\"\n    ```\n\n## Translation Code Mapping\nMapping for each of the translation codes fall within our documentation, start [here](https://docs.3cr.singular.health/responses/codes/S00000.html)\n\nNote: Each code is prefixed with its severity (i.e., bootstrap colouring):\n\n| Prefix | Status        | Colour      |\n|--------|---------------|-------------|\n| `S`    | Successful    | ` success ` |\n| `I`    | Informational | ` info `    |\n| `A`    | Advisory      | ` warning ` |\n| `F`    | Failure       | ` error `   |\n\n## Contributing\n\nPull requests are welcome. For changes, please open an issue first\nto discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)","readmeFilename":"README.md"}