{"id":21998515,"url":"https://github.com/umkus/translate.js","last_synced_at":"2026-05-02T09:35:45.045Z","repository":{"id":89917365,"uuid":"55624350","full_name":"Umkus/translate.js","owner":"Umkus","description":"Painless drop-in client-side translation","archived":false,"fork":false,"pushed_at":"2016-04-07T08:08:15.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T11:48:00.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Umkus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2016-04-06T16:57:44.000Z","updated_at":"2016-04-06T16:58:32.000Z","dependencies_parsed_at":"2023-05-30T12:30:13.092Z","dependency_job_id":null,"html_url":"https://github.com/Umkus/translate.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Umkus%2Ftranslate.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Umkus%2Ftranslate.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Umkus%2Ftranslate.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Umkus%2Ftranslate.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Umkus","download_url":"https://codeload.github.com/Umkus/translate.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056906,"owners_count":20553856,"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":[],"created_at":"2024-11-29T22:25:12.073Z","updated_at":"2026-05-02T09:35:44.996Z","avatar_url":"https://github.com/Umkus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# translate.js\n\nPainless client-side drop-in internationalization without dependencies.\n\n## How it works\n\nThe script replaces marked tags' content with matching strings from the vocabulary json file.\nThe target translation language is determined based on the client browser settings.\nSee the demo [here](http://umkus.com/translate.js/demo.html).\n\n## Usage\n\n 1. Prepare the `vocabulary.json` file like the following:\n ```json\n{\n    \"hello_world\": {\n        \"en\": \"Hello, world!\",\n        \"it\": \"Ciao mondo!\",\n        \"es\": \"¡Hola Mundo!\",\n        \"fr\": \"Bonjour le monde!\"\n    }\n}\n```\n\n 2. Include `translate.js` in the page's `\u003chead\u003e`:\n \n ```html\n \u003cscript type=\"application/javascript\" src=\"translate.js\" data-translate-vocabulary=\"vocabulary.json\"\u003e\u003c/script\u003e\n ```\n \n 3. Make sure the contents of `data-translate-vocabulary` is a uri to the `vocabulary.json`\n 4. Mark the tags with translatable content with `data-translate=\"hello_world\"`\n \n## Examples\n \n ```html\n \u003ch4 data-translate=\"cake_lie\"\u003eThe cake is a lie\u003c/h4\u003e\n ```\n\n ```html\n \u003ctitle data-translate=\"main_title\"\u003eMike's burgers\u003c/title\u003e\n ```\n\n ```html\n \u003cimg src=\"logo.png\" alt=\"Beautiful downtown apartment\" data-tranlsate-alt=\"downtown_apartment\"/\u003e\n ```\n \n ```html\n \u003cdiv data-translate=\"menu_main\"\u003eRoot level\u003cdiv\u003eUnaffected\u003c/div\u003e\u003c/div\u003e\n ```\n\n## Issues\n Not possible to serve vocabulary file from a different domain out of the box. Additional webserver configuration is required.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumkus%2Ftranslate.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumkus%2Ftranslate.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumkus%2Ftranslate.js/lists"}