{"id":18817292,"url":"https://github.com/blueberryapps/ts-translate","last_synced_at":"2025-08-29T17:33:37.924Z","repository":{"id":18437363,"uuid":"84299821","full_name":"blueberryapps/ts-translate","owner":"blueberryapps","description":"Translate, Interplate, format text into different localisations for React applications.","archived":false,"fork":false,"pushed_at":"2023-01-25T23:36:33.000Z","size":1552,"stargazers_count":36,"open_issues_count":12,"forks_count":5,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-07-30T08:04:20.845Z","etag":null,"topics":["blueberry-opensource","editor","formatter","i18n","internationalization","interpolation","javascript","localization","redux","translation-server","translations"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/blueberryapps.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-03-08T08:58:11.000Z","updated_at":"2025-03-02T09:59:03.000Z","dependencies_parsed_at":"2023-02-14T12:31:22.360Z","dependency_job_id":null,"html_url":"https://github.com/blueberryapps/ts-translate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blueberryapps/ts-translate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueberryapps%2Fts-translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueberryapps%2Fts-translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueberryapps%2Fts-translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueberryapps%2Fts-translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blueberryapps","download_url":"https://codeload.github.com/blueberryapps/ts-translate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueberryapps%2Fts-translate/sbom","scorecard":{"id":244384,"data":{"date":"2025-08-11","repo":{"name":"github.com/blueberryapps/ts-translate","commit":"65a0ca24e69e7365a6f48a3fc20afb7f6be71bae"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":10,"reason":"all changesets reviewed","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":"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":"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":"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":"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":"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":"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":"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":"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"76 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-f9cm-qmx5-m98h","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-mvjj-gqq2-p4hw","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v","Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx","Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T07:17:03.311Z","repository_id":18437363,"created_at":"2025-08-17T07:17:03.311Z","updated_at":"2025-08-17T07:17:03.311Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272732998,"owners_count":24984257,"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-08-29T02:00:10.610Z","response_time":87,"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":["blueberry-opensource","editor","formatter","i18n","internationalization","interpolation","javascript","localization","redux","translation-server","translations"],"created_at":"2024-11-08T00:10:39.371Z","updated_at":"2025-08-29T17:33:37.897Z","avatar_url":"https://github.com/blueberryapps.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Translate [![CircleCI](https://circleci.com/gh/blueberryapps/ts-translate.svg?style=svg\u0026circle-token=a563b2487e38a0b14313458d81abf949ea784c25)](https://circleci.com/gh/blueberryapps/ts-translate) [![Dependency Status](https://dependencyci.com/github/blueberryapps/ts-translate/badge)](https://dependencyci.com/github/blueberryapps/ts-translate)\n\nHelps you to translate text from messages object. Allows you to format numbers, dates,\ninterpolate text to string templates, default text as key, scoping translations,\nputting it to React Redux application with Provider and decorator (same pattern as Redux is using).\n\nAlso it supports connection to [translation server](https://github.com/blueberryapps/translation-server)\nwith possibility to download translation on both server and browser side.\nFreeze translations with releases created in translation server.\nAlso there is possibility of live updates of translations via Server Side Events.\n\n```\nyarn add ts-translate\n```\n\n## Vanilla JS usage\n\n```javascript\nimport { fromJS } from 'immutable';\nimport { Translator } from 'ts-translate';\n\n\nconst translator = new Translator({\n  messages: fromJS({\n    en: {\n      foo: 'bar',\n      bar: {\n        foo: 'FooBar'\n        'Some Headline': 'Super Headline'\n      }\n    }\n  }),\n  locale: 'en'\n});\n\ntranslator.text('foo') // =\u003e 'bar'\ntranslator.msg('foo') // =\u003e 'bar'\ntranslator.msg('foo', { scope: 'bar' }) // =\u003e 'FooBar'\ntranslator.msg('Some headline') // Not found will return text in first argument =\u003e 'Some headline'\ntranslator.msg('Some headline', { scope: 'bar' }) // =\u003e 'Super Headline'\n\ntranslator.hasMsg('foo') // =\u003e true'\ntranslator.hasMsg('Some headline') //=\u003e false\n\ntranslator.msg('Not found text', { disableDefault: true })\n// =\u003e Will not return default text (Not found text) instead it will return 'null'\n\ntranslator.formatNumber(123456.78) // =\u003e 123,456.78\ntranslator.formatNumber(123456.78, {precision: 1}) // =\u003e 123,456.8\ntranslator.formatNumber(123456.78, {precision: 0}) // =\u003e 123,457\ntranslator.formatNumber(123456.78, {delimiter: '.', separator: ','}) // =\u003e 123.456,78\ntranslator.formatNumber(123456.78, {template: '%n %u', unit: '%'}) // =\u003e 123.456,78 %\ntranslator.formatNumber(123456.78, {template: '%n $'}) // =\u003e 123.456,78 $\n\ntranslator.formatCurrency(123456.78, {unit: '€'}) // =\u003e 123.456,78 €\ntranslator.formatPercentage(123456.78) // =\u003e 123.456,78 %\n\ntranslator.formatDate(new Date, 'M.D. YYYY') // =\u003e 28.2. 2017 -\u003e using moment.js syntax\ntranslator.formatDate(new Date, 'short') // =\u003e 28.2. 2017 -\u003e using aliases (look down to Formats specification)\n```\n\n## Msg \u0026 Cnt\n\n`msg()` is returning by default React component which has set `toString()` set to return translated result so `msg()` will work correctly in `\u003cinput placeholder={msg('placeholder')} /\u003e`. `cnt()` is alias for `msg()` (deprecated).\n\nif you need to return only translated result use `text()`.\n\n## Interpolation\n\nYou can easily interpolate your translations with variables that will be evaluated during the execution of code and inserted into resulting strings.\n\n```javascript\n{\n  messages: fromJS({\n    'This is value of %{key}: %{value}': 'Este es el valor de %{key}: %{value}',\n    noninterpolatedKey: 'You have %{count} unread messages',\n    deeper: {\n      scopedKey: 'This is scoped and shows %{foo}',\n    }\n  })\n}\n```\n\nUsage:\n```javascript\n  msg('This is value of %{key}: %{value}', { key: 'foo', value: 'bar' })\n  // =\u003e \"Este es el valor de foo: bar\"\n  msg('noninterpolatedKey', { count: 42 })\n  // =\u003e \"You have 42 unread messages\"\n  msg('No need for translation to %{action} %{what}', { action: 'show', what: 'that' })\n  // =\u003e \"No need for translation to show that\"\n  msg('scopedKey', { scope: 'deeper', foo: 'BAR!' })\n  // =\u003e \"This is scoped and shows BAR!\"\n```\n\n\n## Formats Spefication\n\nyou can modify default formatting options by specifying:\n```javascript\n{\n  messages fromJS({\n    en: {\n      formats: {\n        date: {\n          default: { // formatDate(new Date)\n            format: 'D.M.YYYY',\n          },\n          shortTime: { // formatDate(new Date, 'short')\n            format: 'H:m'\n          },\n          long: { // formatDate(new Date, 'long')\n            format: 'D.M.YY H:m:s'\n          }\n        },\n        number: {\n          default: {\n            precision: 2\n          },\n          currency: { // formatNumber(123, 'percentage') === formatPercentage(123)\n            unit: '€'\n          },\n          percentage: { // formatNumber(123, 'percentage') === formatPercentage(123)\n            template: '%n %'\n          },\n          custom: { // formatNumber(123, 'custom')\n            precision: 3\n          }\n        }\n      }\n    }\n  })\n}\n```\n\nthis will enable you to use:\n```javascript\ntranslator.formatNumber(123456.78) // =\u003e 123,456.78\ntranslator.formatNumber(123456.78, 'currency') // =\u003e 123,456.78 € -\u003e using alias\ntranslator.formatCurrency(123456.78) // =\u003e 123.456,78 €\ntranslator.formatPercentage(123456.78) // =\u003e 123.456,78 %\n\ntranslator.formatDate(new Date, 'shortTime') // =\u003e 19:23 -\u003e using alias\ntranslator.formatDate(new Date, 'long') // =\u003e 28.2.2017 19:23:16 -\u003e using alias\n\ntranslator.formatNumber(123456.78, { precision: 1, separator: ',', delimiter: '' }) // =\u003e 123456,7 € -\u003e using custom options\n```\n\nAll number formatting options:\n\n```javascript\n{\n  precision: 10, // number of decimal places\n  delimiter: ',', // used in 10,000,000.10\n  format: defaultDateFormat,\n  separator: '.', // used in 10.10\n  template: '%n %u', // %n is placeholder for number, %u is for unit\n  unit: '',\n  trimTrailingZeros: true, // will remove exessive zeros 10.1200 -\u003e 10.12\n}\n```\n\n## React + Redux\n\n```javascript\nimport { Provider as TranslateProvider, translate, reducer, changeLocale } from 'ts-translate';\nimport { fromJS } from 'immutable'\nimport { createStore, combineReducers } from 'redux';\nimport { Provider as ReduxProvider } from 'react-redux';\n\nconst initial = {\n  messages: fromJS({\n    cs: { home: { description: 'Foo', fallback: 'Fallback' } },\n    en: { home: { description: 'enFoo', about: 'Bar' } }\n  }),\n  locale: 'cs',\n  fallbackLocale: 'en'\n};\n\n// translation reducer must be added under `translate` key\nconst store = createStore(combineReducers({ translate: reducer }), { translate: initial});\n\nclass MyComponent extends React.Component {\n  render() {\n    const { msg } = this.props;\n    return (\u003cdiv\u003e{msg('Something nice')}\u003c/div\u003e);\n  }\n}\n\nconst TranslatedMyComponent = translate()(MyComponent);\nconst TranslatedScopedMyComponent = translate('home')(MyComponent);\n\nstore.dispatch(changeLocale('en')); // change locale to en\n\n\u003cReduxProvider store={store} \u003e\n  \u003cTranslateProvider\u003e\n    \u003cTranslatedMyComponent /\u003e // will look for key 'Something nice' in root of locale messages\n    \u003cTranslatedScopedMyComponent /\u003e // will look for key 'Something nice' in `home` scope of locale messages\n  \u003c/TranslateProvider\u003e\n\u003c/ReduxProvider\u003e\n```\n\n## Translation server\n\nEnable application to send and receive translations from Translation server.\n\n- __apiUrl__ - url to translation server\n- __apiToken__ - project token is needed for enabling synchronization\n- __sync__ - enable synchronization of translations (remembers translations, sends them to server and receives translations back)\n- __liveSync__ - enable Server Side Events for instant refresh of translations directly after update in translation server\n- __releasesDir__ - directory to store releases (needed for releases workflow)\n\n### Task for communicating with Translation server\n\nEnables you to list and download releases to your project.\n\n```\nyarn translate-list // List all created releases\nyarn translate-fetch // Download one specified release (for locale) to specified folder\nyarn translate-fetch-latest-releases // Download all latest releases for all locales\n```\n\nBoth commands supports taking `apiToken` and `apiUrl` from ENV variables (`TRANSLATE_API_TOKEN`, `TRANSLATE_API_URL`) or command line (`--apiToken`, `--apiUrl`) arguments.\n\nFetch commands also needs `--releasesDir` option for specifiyng where to save downloaded releases.\n\n### Passing config to Provider\n\n```javascript\nimport { Provider as TranslateProvider } from 'ts-translate';\n\nconst config = {\n  apiUrl: 'https://translations.blueberry.io',\n  apiToken: 'XYZ',\n  sync: true,\n  liveSync: true\n}\n\n\u003cTranslateProvider config={config}\u003e\n  // ...\n\u003c/TranslateProvider\u003e\n```\n\n### How to locate translations on different pages\n\nYou need to pass `pathname` or `history` object to `TranslateProvider`\n\n```javascript\n\u003cTranslateProvider config={config} pathname=\"/some/path\"\u003e\n  // ...\n\u003c/TranslateProvider\u003e\n```\n\n```javascript\nimport createHistory from 'history/createBrowserHistory';\nconst history = createHistory();\n\n\u003cTranslateProvider config={config} history={history}\u003e\n  // ...\n\u003c/TranslateProvider\u003e\n```\n\n### In App editor\n\n![Translation Editor](https://raw.githubusercontent.com/blueberryapps/ts-translate/master/editor_preview.png)\n\nJust add new wrapper `TranslateEditor` around your code. This Editor must be under `TranslateProvider` context\n\n```javascript\nimport TranslateEditor from 'ts-translate/lib/editor';\n\n\u003cTranslateProvider config={config} pathname=\"/some/path\"\u003e\n  \u003cTranslateEditor pathname=\"/some/path\"\u003e\n    // ...\n  \u003c/TranslateEditor\u003e\n\u003c/TranslateProvider\u003e\n```\n\nsame rule for `pathname` and `history` as for `TranslateProvider` applies for `TranslateEditor`.\n\nfor disabling whole editor functionality (for example in production) set ENV variable `TRANSLATE_DISABLE_EDITOR=t`.\nWhen you are using webpack don't forget to add this to [DefinePlugin](https://webpack.js.org/plugins/define-plugin/)\nas `new webpack.DefinePlugin({ 'process.env.TRANSLATE_DISABLE_EDITOR': true })`.\nAlso if you are using minifier the whole code gets removed by death code removal.\nSo it is pretty easy to use this editor in development and stage,\nbut it will not increase size in production build.\n\n### On server side preload latest translations from TS\n\n```javascript\nimport { fetchTranslations } from 'ts-translates';\n\nfetchTranslations(config)(dispatch);\n```\n\n## Made with love by\n[![](https://camo.githubusercontent.com/d88ee6842f3ff2be96d11488aa0d878793aa67cd/68747470733a2f2f7777772e676f6f676c652e636f6d2f612f626c75656265727279617070732e636f6d2f696d616765732f6c6f676f2e676966)](https://www.blueberry.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueberryapps%2Fts-translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblueberryapps%2Fts-translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueberryapps%2Fts-translate/lists"}