{"id":24126565,"url":"https://github.com/web-packages/web_localization","last_synced_at":"2026-03-04T06:33:13.308Z","repository":{"id":196414731,"uuid":"696058671","full_name":"web-packages/web_localization","owner":"web-packages","description":"An ideally implemented simple web user-language localization example in a service worker environment.","archived":false,"fork":false,"pushed_at":"2024-08-27T13:05:00.000Z","size":56,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-18T19:30:02.720Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/web-packages.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-09-25T01:53:22.000Z","updated_at":"2024-08-27T13:05:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"875267cb-d0d3-4ad3-a10f-defb35d28b7f","html_url":"https://github.com/web-packages/web_localization","commit_stats":null,"previous_names":["mttankkeo/web_localization","web-packages/web_localization"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/web-packages/web_localization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-packages%2Fweb_localization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-packages%2Fweb_localization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-packages%2Fweb_localization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-packages%2Fweb_localization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web-packages","download_url":"https://codeload.github.com/web-packages/web_localization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-packages%2Fweb_localization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30074183,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-01-11T16:34:28.702Z","updated_at":"2026-03-04T06:33:13.265Z","avatar_url":"https://github.com/web-packages.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/f1d4902f-93a8-48ca-81fc-4f1b6d190eb5\"\u003e\n    \u003ch1\u003eWeb Localization\u003c/h1\u003e\n    \u003ctable\u003e\n        \u003cthead\u003e\n          \u003ctr\u003e\n            \u003cth\u003eVersion\u003c/th\u003e\n            \u003cth\u003ev1.0.0-dev\u003c/th\u003e\n          \u003c/tr\u003e\n        \u003c/tbody\u003e\n    \u003c/table\u003e\n\u003c/div\u003e\n\nIdeally Implemented simple web user-language localization example.\n\n\u003e [!WARNING]\n\u003e The example doesn't work in the local environment, And i'll be renewing \u003cbr\u003ethis package for the better soon.\n\n\u003e You can use `server-side rendering` and `service worker` to resolve lazy load issues.\n\n## Usage\n\nThe following describes how to define the contents of the json files within the localizations folder, \u003cbr /\u003e\nAnd this example json file is `korean.json` provided by default.\n\n\u003e How to define parameters is by inserting {`index`} to content `json value`.\n\n```json\n{\n    \"undefined\": \"정의되지 않음\",\n    \"hello\": \"안녕하세요\",\n    \"amount\": \"{0}개\"\n}\n```\n\nAnd next, it describes how to output localized sentences and words defined in the json content by declaring html elements.\n```html\n\u003c!-- Sentences and words --\u003e\n\u003clocalization-element key=\"hello\"\u003e\u003c/localization-element\u003e\n\n\u003c!-- Use place holder, (flexible localizable way) --\u003e\n\u003clocalization-element key=\"amount\" parms=\"123\"\u003e\u003c/localization-element\u003e\n```\n\n## How to define language you want\nDeclares a global and statically variable called language\n\n\u003e The value defined must be the name of the json file.\n\u003e \n```js\n// This value is the current language name(json name) to be applied.\nconst language = 'korean';\n```\n\n### Reason\nThis is basically because it always refers to a variable called `language`.\n\n![sdfsfdsfs](https://github.com/MTtankkeo/web_localization/assets/122026021/afaa47f3-1c57-440b-9d01-5d758494d59c)\n\n## How to customizing\n\nThe following describes how to redefine custom-element name.\n\n\u003e `-` must be included in element name.\n\n```js\n// Define the first argument of customElements.define with the name you want.\ncustomElements.define('localization-element', LocalizationElement);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-packages%2Fweb_localization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb-packages%2Fweb_localization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-packages%2Fweb_localization/lists"}