{"id":19623841,"url":"https://github.com/appleple/lang-select","last_synced_at":"2026-06-03T23:31:47.572Z","repository":{"id":39061584,"uuid":"276298339","full_name":"appleple/lang-select","owner":"appleple","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-07T19:54:08.000Z","size":12467,"stargazers_count":1,"open_issues_count":19,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-09T11:55:39.780Z","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/appleple.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":"2020-07-01T06:42:56.000Z","updated_at":"2021-03-14T22:31:41.000Z","dependencies_parsed_at":"2023-02-07T23:45:39.234Z","dependency_job_id":null,"html_url":"https://github.com/appleple/lang-select","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/appleple%2Flang-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Flang-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Flang-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Flang-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleple","download_url":"https://codeload.github.com/appleple/lang-select/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240921539,"owners_count":19878949,"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-11T11:35:48.193Z","updated_at":"2026-06-03T23:31:47.565Z","avatar_url":"https://github.com/appleple.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lang-select\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://raw.githubusercontent.com/appleple/document-outliner/master/LICENSE)\n\nA utility to suggest page transition when a visitor is browsing the site written in not his/her first language. \n[http://tajima.appleple.jp/sample/LangSelect/example/en/](http://tajima.appleple.jp/sample/LangSelect/example/en/)\n\n## Usage\n```html\n\u003cscript src=\"js/lang-select.js\"\u003e\u003c/script\u003e\n```\n\nWrite \"div tag\" and \"javascript\".\n```html\n\u003cdiv id=\"foge\"\u003e\u003c/div\u003e\n\n\n\u003cscript\u003e\n    window.addEventListener('DOMContentLoaded', function(){\n\tnew LangSelect(\"foo\", [\n        {\"lang\": \"language code of ISO 639\", \"url\": \"http://example.com\", \"message\": \"message\", \"btn_message\": \"message on button\"},\n    ])});\n\u003c/script\u003e\n```\n\nIf a visitor is browsing the site written in not his/her first language and LangSelect instance has \"url\" of his/her first language, \"div tag\" becomes as below.\n```html\n\u003cdiv class=\"active\" id=\"foge\"\u003e\n  \u003cdiv class=\"message\"\u003e\n\t\u003cp\u003emessage\u003c/p\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"change-site\"\u003e\n\t\u003cbutton onclick=\"http://example.com\"\u003emessage on button\u003c/button\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"reject-message\"\u003e\n\t\u003cbutton\u003e\u003c/button\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n## Example\n\n```html\n\u003cdiv id=\"foge\"\u003e\u003c/div\u003e\n\n\u003cscript\u003e\n    window.addEventListener('DOMContentLoaded', function(){\n\tnew LangSelect(\"foo\", [\n        {\"lang\": \"ja\", \"url\": \"../ja/index.html\", \"message\": \"日本向けサイトがあります\", \"btn_message\": \"クリック\"},\n    ])});\n\u003c/script\u003e\n```\n\nIf a visitor is browsing the site written in not visitor's first language and he/she use Japanease, \"div tag\" becomes as below.\n```html\n\u003cdiv id=\"foge\"\u003e\n  \u003cdiv class=\"message\"\u003e\n\t\u003cp\u003e日本向けサイトがあります\u003c/p\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"change-site\"\u003e\n\t\u003cbutton onclick=\"ユーザが入力した遷移先\"\u003eクリック\u003c/button\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"reject-message\"\u003e\n\t\u003cbutton\u003e\u003c/button\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleple%2Flang-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleple%2Flang-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleple%2Flang-select/lists"}