{"id":13760251,"url":"https://github.com/ttag-org/ttag","last_synced_at":"2025-05-10T10:32:06.645Z","repository":{"id":15734989,"uuid":"78681287","full_name":"ttag-org/ttag","owner":"ttag-org","description":":orange_book: simple approach for javascript localization","archived":false,"fork":false,"pushed_at":"2024-03-01T12:27:21.000Z","size":2601,"stargazers_count":329,"open_issues_count":44,"forks_count":39,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-14T13:15:19.415Z","etag":null,"topics":["es6","i18n","javascript-localization","localization","template-literals"],"latest_commit_sha":null,"homepage":"https://ttag.js.org/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttag-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-11T21:26:37.000Z","updated_at":"2024-04-27T14:43:53.240Z","dependencies_parsed_at":"2023-01-13T18:33:45.933Z","dependency_job_id":"e30e687e-cebc-400c-b65e-572223b62349","html_url":"https://github.com/ttag-org/ttag","commit_stats":{"total_commits":412,"total_committers":20,"mean_commits":20.6,"dds":0.5097087378640777,"last_synced_commit":"75245c618d8a20d97096b6607500633003b8dcd3"},"previous_names":["c-3po-org/c-3po"],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttag-org%2Fttag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttag-org%2Fttag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttag-org%2Fttag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttag-org%2Fttag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttag-org","download_url":"https://codeload.github.com/ttag-org/ttag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224949743,"owners_count":17397230,"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","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":["es6","i18n","javascript-localization","localization","template-literals"],"created_at":"2024-08-03T13:01:06.067Z","updated_at":"2024-11-16T17:30:53.444Z","avatar_url":"https://github.com/ttag-org.png","language":"TypeScript","readme":"[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct.svg)](https://stand-with-ukraine.pp.ua)\n\n\u003cdiv align='center'\u003e\n\n[![ttag](https://github.com/ttag-org/ttag/blob/master/website/static/img/ttag.svg)](https://ttag.js.org/)\n\nModern javascript i18n localization library based on ES6 tagged templates and the good old GNU gettext\n\n[![travis](https://api.travis-ci.org/ttag-org/ttag.svg?master)](https://travis-ci.org/ttag-org/ttag) [![codecov](https://codecov.io/gh/ttag-org/ttag/branch/master/graph/badge.svg)](https://codecov.io/gh/ttag-org/ttag) ![downloads](https://img.shields.io/npm/dm/ttag.svg)\n\n[![NPM](https://nodei.co/npm/ttag.png?downloads=true)](https://nodei.co/npm/ttag/)\n\n\u003c/div\u003e\n\n---\n\n## Key features\n\n-   Uses ES6 template literals for string formatting (no need for sprintf).\n-   Contexts [support](https://ttag.js.org/docs/context.html)\n-   It can precompile translations on a build step.\n-   Plurals support [ngettext](https://ttag.js.org/docs/ngettext.html).\n-   It can be integrated in any build tool that works with babel.\n-   Has a builtin [validation](https://ttag.js.org/docs/translations-validation.html) for translated strings format.\n-   It can use any default locale in sources (not only English).\n-   Handles [React (jsx) translations](https://ttag.js.org/docs/jsx-gettext.html).\n-   Can be easily integrated with Create React App. [CRA doc](https://ttag.js.org/docs/create-react-app.html)\n\n## Usage example\n\n```js\nimport { t, ngettext, msgid } from 'ttag';\n\n// formatted strings\nconst name = 'Mike';\nconst helloMike = t`Hello ${name}`;\n\n// plurals (works for en locale out of the box)\nconst n = 5;\nconst msg = ngettext(msgid`${n} task left`, `${n} tasks left`, n);\n```\n\n## Installation\n\n```bash\nnpm install --save ttag\n```\n\n## CLI\n\nYou may also need to install ttag-cli for `po` files manipulation.\n\n**ttag cli** - [https://github.com/ttag-org/ttag-cli](https://github.com/ttag-org/ttag-cli)\n\n```bash\nnpm install --save-dev ttag-cli\n```\n\n## Usage from CDN\n\n[https://unpkg.com/ttag/dist/ttag.min.js](https://unpkg.com/ttag/dist/ttag.min.js)\n\n\u003e This project is designed to work in pair with [babel-plugin-ttag](https://github.com/ttag-org/babel-plugin-ttag).  \n\u003e But you can also play with it [without transpilation](https://ttag.js.org/docs/quickstart.html).\n\n## Support\n\nGive a ⭐️ if this project helped you!\n\n## Useful links\n\n-   [Documentation](https://ttag.js.org/)\n-   [Changelog](https://ttag.js.org/docs/changelog.html)\n-   [Quick Start](https://ttag.js.org/docs/quickstart.html)\n-   [Quick view on JsFiddle playground](https://jsfiddle.net/0atw0hgh/)\n\n### Slides from talks\n\n-   [Kyivjs 2017](https://docs.google.com/presentation/d/1oj6ZaXfIfcClROe-4kOMMjnXFExn1gUfF6D30VyznWs/edit?usp=sharing)\n-   [Odessajs 2017](https://docs.google.com/presentation/d/1XB82-hTLQxP456Bk8UWJb-tZBsHnUHp4lJzmQorxNgs/edit?usp=sharing)\n\n### Talks\n\n-   [Odessajs 2017 (video RU)](https://www.youtube.com/watch?v=9QjzpfA9LH4)\n\n## License\n\nThis project is licensed under the [MIT](https://github.com/eckertalex/cheatsheep/blob/main/LICENSE) license.\n","funding_links":[],"categories":["I18n And L10n","Libraries","I18n And L10n [🔝](#readme)","国际化和本地化"],"sub_categories":["Runner","Localization","运行器","运行器e2e测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttag-org%2Fttag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttag-org%2Fttag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttag-org%2Fttag/lists"}