{"id":20933616,"url":"https://github.com/greatislander/tenpercent","last_synced_at":"2026-03-14T05:34:46.855Z","repository":{"id":31286375,"uuid":"127435474","full_name":"greatislander/tenpercent","owner":"greatislander","description":"A microservice for retrieving the localization status of a given Transifex resource.","archived":false,"fork":false,"pushed_at":"2023-01-06T13:12:53.000Z","size":933,"stargazers_count":5,"open_issues_count":13,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T10:27:46.874Z","etag":null,"topics":["l10n","localization","micro","microservice","transifex","transifex-api"],"latest_commit_sha":null,"homepage":"https://tenpercent.now.sh","language":"JavaScript","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/greatislander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-30T14:11:56.000Z","updated_at":"2021-03-12T20:36:53.000Z","dependencies_parsed_at":"2023-01-14T18:43:24.547Z","dependency_job_id":null,"html_url":"https://github.com/greatislander/tenpercent","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greatislander%2Ftenpercent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greatislander%2Ftenpercent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greatislander%2Ftenpercent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greatislander%2Ftenpercent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greatislander","download_url":"https://codeload.github.com/greatislander/tenpercent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020902,"owners_count":22000805,"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":["l10n","localization","micro","microservice","transifex","transifex-api"],"created_at":"2024-11-18T21:55:59.480Z","updated_at":"2026-03-14T05:34:46.793Z","avatar_url":"https://github.com/greatislander.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ten Percent\n\n[![GitHub license](https://img.shields.io/github/license/greatislander/tenpercent.svg)](https://github.com/greatislander/tenpercent/blob/master/LICENSE.md) [![Travis branch](https://img.shields.io/travis/greatislander/tenpercent/dev.svg)](https://travis-ci.org/greatislander/tenpercent/) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)\n\nTen Percent (l10n percent) is a Node.js microservice which uses the [Transifex REST API](https://docs.transifex.com/api/introduction) to retrieve the localization status of a given Transifex resource. I made Ten Percent so that I could use a [Shields.io dynamic badge](http://shields.io/#dynamic-badge) to display the localization status of the [Pressbooks](https://github.com/pressbooks/pressbooks) Open Source project's resources and encourage ongoing localization efforts. Hopefully others will find it useful for their projects as well.\n\n## Requirements\n\n- A [Transifex API token](https://www.transifex.com/user/settings/api/)\n- A [Vercel](https://vercel.com) account.\n\n## Setup\n\n1. Install the [Vercel CLI](https://vercel.com/download) on your device and log in to your Vercel account.\n2. Add your Transifex API token as a [secret](https://vercel.com/docs/cli#commands/secrets):\n\n    ```bash\n    vercel secrets add transifex-api-token \"\u003cTOKEN\u003e\"\n    ```\n\n3. Deploy [greatislander/tenpercent](https://github.com/greatislander/tenpercent/) to Vercel. Be sure to assign the secret you created in step 2 to the `TRANSIFEX_API_TOKEN` environment variable:\n\n    ```bash\n    vercel greatislander/tenpercent -e TRANSIFEX_API_TOKEN=@transifex-api-token\n    ```\n\n## Usage\n\n1. Visit your Vercel deploy, supplying the query parameters for `organization`, `project`, and optionally `resource` (`resource` defaults to `0`, the first resource by numeric index; if the project has multiple resources, you can select the appropriate one by supplying a different value). Verify that the resulting JSON object reflects the localization status of the desired resource (a numeric value corresponding to the percentage translated):\n\n    ```bash\n    $ curl 'https://\u003cSUBDOMAIN\u003e.vercel.app?organization=\u003cORGANIZATION\u003e\u0026project=\u003cPROJECT\u003e[\u0026resource=\u003cRESOURCE INDEX\u003e]'\n    {\"status\":\"10\"}\n    ```\n\n    If the API token is missing or invalid or if you have specified a non-existent Transifex organization, project or resource, you will see an error message.\n\n2. Use the URL you determined in step 1 to generate a [Shields.io dynamic badge](http://shields.io/#dynamic-badge) that shows the localization status of your Transifex project. You'll need to set the data type to JSON and the query to `$.status`.\n\n    `https://img.shields.io/badge/dynamic/json.svg?url=\u003cURL\u003e\u0026label=translated\u0026query=$.status.\u0026colorB=\u003cCOLOR\u003e\u0026prefix=\u003cPREFIX\u003e\u0026suffix=%25`\n\n    This URL will produce the following badge layout with the example response in step 1:\n\n    ![Example Badge](https://img.shields.io/badge/translated-10%25-red.svg)\n\n    Now you can add a badge to your GitHub readme which will reflect the current localization status of your project.\n\n## Notes\n\nResponses from the Transifex REST API are cached for 24 hours to prevent excessive API calls, so you may not see the changes immediately.\n\n## Related Work\n\n- https://github.com/transifex/transifex/issues/319\n- https://github.com/niccokunzmann/open-transifex-api/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreatislander%2Ftenpercent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreatislander%2Ftenpercent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreatislander%2Ftenpercent/lists"}