{"id":15509651,"url":"https://github.com/willin/hyperapp-i18n","last_synced_at":"2025-04-23T02:32:33.305Z","repository":{"id":143880746,"uuid":"118219858","full_name":"willin/hyperapp-i18n","owner":"willin","description":"I18n Plugin for Hyperapp","archived":false,"fork":false,"pushed_at":"2018-03-10T18:02:15.000Z","size":21,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T16:39:19.211Z","etag":null,"topics":["hyperapp","i18n"],"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/willin.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,"governance":null}},"created_at":"2018-01-20T07:27:55.000Z","updated_at":"2020-06-26T17:40:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"fceb48b4-18fa-4a87-b996-dfb150b85503","html_url":"https://github.com/willin/hyperapp-i18n","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"696ec98348300afd2380c60808835ceffdce11bb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fhyperapp-i18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fhyperapp-i18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fhyperapp-i18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fhyperapp-i18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willin","download_url":"https://codeload.github.com/willin/hyperapp-i18n/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250357767,"owners_count":21417351,"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":["hyperapp","i18n"],"created_at":"2024-10-02T09:43:25.858Z","updated_at":"2025-04-23T02:32:33.228Z","avatar_url":"https://github.com/willin.png","language":"JavaScript","readme":"# \u003cimg height=24 src=https://cdn.rawgit.com/jorgebucaran/f53d2c00bafcf36e84ffd862f0dc2950/raw/882f20c970ff7d61aa04d44b92fc3530fa758bc0/Hyperapp.svg\u003e hyperapp-i18n\n\n[![Travis CI](https://img.shields.io/travis/willin/hyperapp-i18n/master.svg)](https://travis-ci.org/willin/hyperapp-i18n) [![Codecov](https://img.shields.io/codecov/c/github/willin/hyperapp-i18n/master.svg)](https://codecov.io/gh/willin/hyperapp-i18n) [![npm](https://img.shields.io/npm/v/hyperapp-i18n.svg)](https://www.npmjs.org/package/hyperapp-i18n) [![Slack](https://hyperappjs.herokuapp.com/badge.svg)](https://hyperappjs.herokuapp.com \"Join us\")\n\nI18n Plugin for [Hyperapp](https://github.com/hyperapp/hyperapp).\n\n## Installation\n\nInstall with npm or Yarn.\n\n```\nnpm i hyperapp-i18n\n```\n\nIf you don't want to set up a build environment, you can download Hyperapp I18n from a CDN like [unpkg.com](https://unpkg.com/hyperapp-i18n) and it will be globally available through the window.i18n object. If your library is a high-order-app, export it as window.i18n.\n\n```html\n\u003cscript src=\"https://unpkg.com/hyperapp-i18n\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n```js\n// i18n.js\nimport i18n from 'hyperapp-i18n';\n\nexport const { state, actions } = i18n({\n  'zh-CN': {\n    hello: '你好'\n  },\n  'en-US': {\n    hello: 'Hello'\n  }\n}, 'zh-CN');\n\n// app.js\nimport { app, h } from 'hyperapp';\nimport * as i18n from './i18n';\n\nconst state = {\n  i18n: i18n.state\n};\nconst actions = {\n  i18n: i18n.actions\n};\n\nconst view = ({ i18n: { messages, locale } }) =\u003e (\n  \u003cdiv\u003e\n    \u003ch2\u003eCurrent Lang: {locale}\u003c/h2\u003e\n    \u003cp\u003eTest1: {messages.hello}\u003c/p\u003e\n  \u003c/div\u003e\n);\n\nconst main = app(state, actions, view, document.body);\nmain.i18n.set('en-US');\n```\n\nSee the Example folder for more detailed useage info.\n\n## LICENSE\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillin%2Fhyperapp-i18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillin%2Fhyperapp-i18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillin%2Fhyperapp-i18n/lists"}