{"id":20763703,"url":"https://github.com/glenzli/vue-dynamic-locale","last_synced_at":"2026-04-21T05:33:29.215Z","repository":{"id":57395715,"uuid":"133918745","full_name":"glenzli/vue-dynamic-locale","owner":"glenzli","description":"A dynamic multi language plugin for Vue.","archived":false,"fork":false,"pushed_at":"2019-04-15T06:01:52.000Z","size":126,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-24T12:49:01.385Z","etag":null,"topics":["json","locale","multi-language","vue","vuex"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glenzli.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":"2018-05-18T07:23:26.000Z","updated_at":"2021-01-21T04:40:47.000Z","dependencies_parsed_at":"2022-09-16T12:00:33.900Z","dependency_job_id":null,"html_url":"https://github.com/glenzli/vue-dynamic-locale","commit_stats":null,"previous_names":["luz-alphacode/vue-dynamic-locale"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/glenzli/vue-dynamic-locale","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glenzli%2Fvue-dynamic-locale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glenzli%2Fvue-dynamic-locale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glenzli%2Fvue-dynamic-locale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glenzli%2Fvue-dynamic-locale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glenzli","download_url":"https://codeload.github.com/glenzli/vue-dynamic-locale/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glenzli%2Fvue-dynamic-locale/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32078927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T02:38:07.213Z","status":"ssl_error","status_checked_at":"2026-04-21T02:38:06.559Z","response_time":128,"last_error":"SSL_read: 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":["json","locale","multi-language","vue","vuex"],"created_at":"2024-11-17T10:45:37.996Z","updated_at":"2026-04-21T05:33:29.174Z","avatar_url":"https://github.com/glenzli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vue-Dynamic-Locale\n\nA straightforward implemention for multi-language for local Vue app (e.g. electron). You can change language dynamically.\n\n## Install\n\nThe recommended way to install and maintain vue-dynamic-locale in your project is through the Node.js Pacakge Manager (NPM), simply type the npm command in your project folder:\n\n```sh\nnpm install vue-dynamic-locale --save\n```\n\n## Usage\n\nTo use vue-dynamic-locale, you must install it as a Vue plugin with store included in options:\n```javascript\nimport VueDynamicLocale from 'vue-dynamic-locale'\n\n// path is the directory of locale json files.\nconst path = 'static/locale'\n// default locale for the application\nconst defaultLocale = 'en'\n\n// Vuex store must be included in options.\nVue.install(VueDynamicLocale, { store, path, defaultLocale })\n```\n\nThen, you can use **$t** object in your Vue components to access current language for specific key. For example, the language json file may like this:\n\n```json\n{\n  \"Hellow\": {\n    \"World\": \"Dynamic\"\n  },\n  \"Locale\": \"Vue\",\n  \"Array\": [\"Value1\", \"Value2\", \"Value3\"],\n  \"Root\": {\n    \".\": \"Root\", // \".\" is a special key represents it's root\n    \"Child\": \"Child\"\n  }\n}\n```\n\nThen you can use it like this in Vue template:\n```javascript\n$t['Hellow.World'] // === 'Dynamic'\n$t['Locale'] // === 'Vue'\n$t['Array.0'] // === 'Value1'\n$t['Array.2'] // === 'Value3'\n$t['Root'] // === 'Root'\n$t['Root.Child'] // === 'Child'\n```\n\nYou can change locale by **$setLocale()**, and **$getLocales()** to list all avaiable locales in your locale directory.\n\n\n## License\nDistributed under the MIT license. See [LICENSE](https://github.com/luz-alphacode/vue-undoable/blob/master/LICENSE) for detail.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglenzli%2Fvue-dynamic-locale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglenzli%2Fvue-dynamic-locale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglenzli%2Fvue-dynamic-locale/lists"}