{"id":21342682,"url":"https://github.com/serg-io/i18n","last_synced_at":"2026-02-05T09:37:47.826Z","repository":{"id":57140024,"uuid":"165877323","full_name":"serg-io/i18n","owner":"serg-io","description":"Internationalization using tagged template literals.","archived":false,"fork":false,"pushed_at":"2019-02-16T21:39:51.000Z","size":442,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T02:38:35.706Z","etag":null,"topics":["i18n","internationalization","l10n","localization","template-literals","translation"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/serg-io.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}},"created_at":"2019-01-15T15:40:51.000Z","updated_at":"2019-02-16T21:39:52.000Z","dependencies_parsed_at":"2022-09-04T22:10:25.036Z","dependency_job_id":null,"html_url":"https://github.com/serg-io/i18n","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/serg-io/i18n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serg-io%2Fi18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serg-io%2Fi18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serg-io%2Fi18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serg-io%2Fi18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serg-io","download_url":"https://codeload.github.com/serg-io/i18n/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serg-io%2Fi18n/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266998056,"owners_count":24018950,"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-07-25T02:00:09.625Z","response_time":70,"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":["i18n","internationalization","l10n","localization","template-literals","translation"],"created_at":"2024-11-22T01:09:37.951Z","updated_at":"2026-02-05T09:37:42.803Z","avatar_url":"https://github.com/serg-io.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003csection\u003e\n\n## Introduction ##\n\nThis library allows you to use [tagged template literals](\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_templates)\nin your source code to generate content for different languages. This library provides the following\nfunctions:\n\n  * **`load`**: This function can be used to load definitions.\n  * **`i18n`**: Template literals can be tagged with `i18n` to retrieve definitions that have been\n    previously loaded using the `load` function.\n\n\u003c/section\u003e\n\u003csection\u003e\n\n## Installation ##\n\n```bash\nnpm install @serg.io/i18n\n```\n\n\u003c/section\u003e\n\u003csection\u003e\n\n## Example ##\n\nYou must first load the text definitions:\n\n```javascript\nimport i18n, { load } from 'path/to/src/i18n.js';\n\n// Load text definitions.\nload({\n\tuser: {\n\t\tfirstName: 'First name',\n\t\tlastName: 'Last name',\n\t},\n\tsubmit: 'Submit',\n});\n```\n\nOnce your text definitions have been loaded, you can tag template literals using `i18n`. For\ninstance, the following example will change the `innerText` of the `button` with the string\n\"Submit\":\n\n```javascript\nimport i18n, { load } from 'path/to/src/i18n.js';\n\n// Find the submit button.\nconst button = document.querySelector('button[type=\"submit\"]');\n\n// Change its text using i18n.\nbutton.innerText = i18n`submit`;\n```\n\n\u003c/section\u003e\n\u003csection\u003e\n\n## License ##\n\n[MIT](https://github.com/serg-io/i18n/blob/master/LICENSE).\n\n\u003c/section\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserg-io%2Fi18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserg-io%2Fi18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserg-io%2Fi18n/lists"}