{"id":22551030,"url":"https://github.com/louisdevie/elizalina","last_synced_at":"2025-03-28T10:11:25.763Z","repository":{"id":45903540,"uuid":"514908499","full_name":"louisdevie/elizalina","owner":"louisdevie","description":"JavaScript translation library","archived":false,"fork":false,"pushed_at":"2023-04-16T10:09:18.000Z","size":34,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T10:34:47.795Z","etag":null,"topics":["javascript","js","translation","web"],"latest_commit_sha":null,"homepage":"","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/louisdevie.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":"2022-07-17T17:19:56.000Z","updated_at":"2022-07-18T21:52:43.000Z","dependencies_parsed_at":"2023-01-18T02:50:13.453Z","dependency_job_id":null,"html_url":"https://github.com/louisdevie/elizalina","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisdevie%2Felizalina","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisdevie%2Felizalina/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisdevie%2Felizalina/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisdevie%2Felizalina/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/louisdevie","download_url":"https://codeload.github.com/louisdevie/elizalina/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246009078,"owners_count":20708881,"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":["javascript","js","translation","web"],"created_at":"2024-12-07T17:09:27.943Z","updated_at":"2025-03-28T10:11:25.740Z","avatar_url":"https://github.com/louisdevie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"elizalina.svg\" height=\"100px\"\u003e\n\nClient-side JavaScript translation utility\n\n## Compatibility\n\nShould work with :\n* Chrome : 55+ (103 on mobile)\n* Edge : 15+\n* Safari : 11+\n* Firefox : 52+ (101 on mobile)\n* Opera : 42+ (64 on mobile)\n* *IE is not supported*\n\n## Setup\n\n### Hosting the script yourself\n\nDownload the [latest minified version](https://github.com/louisdevie/elizalina/releases/download/v2.0.0/elizalina.min.js)\nand add it to the static resources of your site, then include it in the head of your pages :\n\n```html\n\u003cscript type=\"text/javascript\" src=\"static/elizalina.min.js\"\u003e\u003c/script\u003e\n```\n\n### Getting the script from a CDN\n\nAlternatively, you can get the script from [jsDelivr](https://jsdelivr.com) :\n\n```html\n\u003cscript type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/gh/louisdevie/elizalina@2.0.0/elizalina.min.js\"\u003e\u003c/script\u003e\n```\n\n\n## Usage\n\nAfter the document is loaded (you can have a script overriding `window.onload` or embbeded at the end of the body), execute the following :\n\n```js\nelizalina.addLanguage(\"static/english.json\", \"en\");\nelizalina.addLanguage(\"static/french.json\", \"fr\");\nelizalina.addLanguage(\"static/german.json\", \"de\");\n// ... add the languages you want\nelizalina.fillDocument();\n```\n\nThe JSON files must have the following structure :\n\n```json\n{\n  \"key1\": \"content\",\n  \"key2\": \"content\",\n  \"key3\": \"content\"\n}\n```\n\nThen, all the html tags will classes `elz` and `_my_key` will have their content replaced by the entry matching \"my_key\" (notice how the leading underscore is necessary but trimmed afterwards).\n\n### Working example\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"utf-8\"\u003e\n  \u003cscript type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/gh/louisdevie/elizalina@2.0.0/elizalina.min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003cspan class=\"elz _example\"\u003eIt works!\u003c/span\u003e\n  \n  \u003cscript\u003e\n    // embed the translation in the document\n    elizalina.loadLanguageObject({\"example\": \"Es klappt!\"}, \"de\");\n    // force the page to be in german\n    elizalina.fillDocument(\"de\");\n  \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nSee the [documentation](DOC.md) for more details.\n\n\n## License\n\nElizalina is licensed under the [MIT License](https://github.com/louisdevie/elizalina/blob/main/LICENSE). **The software is provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouisdevie%2Felizalina","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouisdevie%2Felizalina","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouisdevie%2Felizalina/lists"}