{"id":15412565,"url":"https://github.com/cristianbote/react-translate-json","last_synced_at":"2025-09-23T18:35:21.834Z","repository":{"id":57150665,"uuid":"106873643","full_name":"cristianbote/react-translate-json","owner":"cristianbote","description":":earth_americas: Make react speak your language","archived":false,"fork":false,"pushed_at":"2018-03-29T10:48:03.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-28T04:44:24.897Z","etag":null,"topics":["json","preact","react","translate","translations"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cristianbote.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-13T21:10:06.000Z","updated_at":"2020-12-20T18:42:16.000Z","dependencies_parsed_at":"2022-09-03T16:50:27.144Z","dependency_job_id":null,"html_url":"https://github.com/cristianbote/react-translate-json","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cristianbote/react-translate-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristianbote%2Freact-translate-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristianbote%2Freact-translate-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristianbote%2Freact-translate-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristianbote%2Freact-translate-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cristianbote","download_url":"https://codeload.github.com/cristianbote/react-translate-json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristianbote%2Freact-translate-json/sbom","scorecard":{"id":308886,"data":{"date":"2025-08-11","repo":{"name":"github.com/cristianbote/react-translate-json","commit":"e022a03e8081345d6f2582b5660f38278f161d0a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T22:46:06.326Z","repository_id":57150665,"created_at":"2025-08-17T22:46:06.326Z","updated_at":"2025-08-17T22:46:06.326Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276629948,"owners_count":25676631,"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","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["json","preact","react","translate","translations"],"created_at":"2024-10-01T16:53:44.190Z","updated_at":"2025-09-23T18:35:21.786Z","avatar_url":"https://github.com/cristianbote.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Make react speak your language.\n=\n\n[![npm version](https://badge.fury.io/js/react-translate-json.svg?bust)](https://badge.fury.io/js/react-translate-json) \n[![codecov.io Code Coverage](https://img.shields.io/codecov/c/github/cristianbote/react-translate-json.svg?maxAge=2592000)](https://codecov.io/github/cristianbote/react-translate-json?branch=master) \n[![Build Status](https://travis-ci.org/cristianbote/react-translate-json.svg?branch=master)](https://travis-ci.org/cristianbote/react-translate-json)\n\nOverview\n--------\n\n### Instalation\n```\nnpm install --save react-translate-json\n# or\nyarn add react-translate-json\n```\n\n### Getting started\nJust think of it in these steps:\n\n1. Define your translation directory\n1. Define the current user locale code, e.g. `'en'`, `'de'`, `'fr'` and so on.\n1. Optionally use a fallback language code. Usually `'en'`.\n\nThen, use the thin, built-in component, to translate your strings.\n\n#### Example\nThe following examples are based on `create-react-app` results.\n\n```json\n// This is our json file, with translations\n{\n  \"HELLO\": \"Hi {{user}}!\",\n  \"PAGES\": {\n    \"HOME\": {\n      \"TITLE\": \"Home Page Title\"\n    }\n  }\n}\n```\n\n```js\n// This is usually our index.js\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n// Import the TranslateProvider function to provide the service with your settings\nimport { TranslateProvider } from 'react-translate-json';\nimport App from './App';\n\nconst translationOptions = {\n    pathPrefix: '/translations', // Path to your translations\n    locale: 'en', // User current locale\n    fallbackLocale: 'en' // Fallback locale\n};\n\n// That's it! You are all set!\n\nReactDOM.render(\n    \u003cTranslateProvider {...translationOptions}\u003e\n        \u003cApp /\u003e\n    \u003c/TranslateProvider\u003e,\n    document.getElementById('root')\n);\n```\n\nNow, you can easily add in your translations by importing the component.\n\n```js\n// App.js\nimport React, { Component } from 'react';\nimport { TranslateComponent } from 'react-translate-json/react';\n\nclass App extends Component {\n  render() {\n    return (\n      \u003cdiv className=\"App\"\u003e\n        \u003cheader className=\"App-header\"\u003e\n          \u003cimg src={logo} className=\"App-logo\" alt=\"logo\" /\u003e\n          \n          {/* Render-prop based */}\n          \u003cTranslateComponent label=\"PAGES.HOME.TITLE\" render={(res) =\u003e (\n            \u003ch1 className=\"App-title\"\u003e{res}\u003c/h1\u003e\n          )}/\u003e\n          \n          {/* Regular component usage */}\n          \u003ch2 className=\"greet\"\u003e\n              \u003cTranslateComponent label=\"HELLO\" params={{user: 'John'}}/\u003e\n          \u003c/h2\u003e\n\n        \u003c/header\u003e\n        \u003cp className=\"App-intro\"\u003e\n          To get started, edit \u003ccode\u003esrc/App.js\u003c/code\u003e and save to reload.\n        \u003c/p\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\nexport default App;\n```\n\n#### Preact\n```js\n// App.js\nimport { Component, h } from 'preact';\nimport { TranslateComponent } from 'react-translate-json/preact';\n\nclass App extends Component {\n  render() {\n    return (\n      \u003cdiv className=\"App\"\u003e\n          \u003ch2 className=\"greet\"\u003e\n              \u003cTranslateComponent label=\"HELLO\" params={{user: 'John'}}/\u003e\n          \u003c/h2\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\nexport default App;\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristianbote%2Freact-translate-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcristianbote%2Freact-translate-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristianbote%2Freact-translate-json/lists"}