{"id":46270008,"url":"https://github.com/wuespace/honolate","last_synced_at":"2026-03-04T03:02:42.353Z","repository":{"id":325821814,"uuid":"1102458639","full_name":"wuespace/honolate","owner":"wuespace","description":"Honolate is a localization library designed specifically for the Hono web framework in Deno. It provides an easy way to manage translations and localize your web applications.","archived":false,"fork":false,"pushed_at":"2025-11-25T00:23:17.000Z","size":89,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-17T08:19:38.182Z","etag":null,"topics":["backend","deno","gettext","hono","i18n","internationalization","library","localization","translation"],"latest_commit_sha":null,"homepage":"https://jsr.io/@wuespace/honolate/doc","language":"TypeScript","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/wuespace.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-23T13:58:22.000Z","updated_at":"2025-11-30T16:44:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wuespace/honolate","commit_stats":null,"previous_names":["wuespace/honolate"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/wuespace/honolate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Fhonolate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Fhonolate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Fhonolate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Fhonolate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wuespace","download_url":"https://codeload.github.com/wuespace/honolate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Fhonolate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30070479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"online","status_checked_at":"2026-03-04T02:00:07.464Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["backend","deno","gettext","hono","i18n","internationalization","library","localization","translation"],"created_at":"2026-03-04T03:02:40.028Z","updated_at":"2026-03-04T03:02:42.346Z","avatar_url":"https://github.com/wuespace.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Honolate – Localization for Hono in Deno\n\n[![JSR Scope](https://jsr.io/badges/@wuespace)](https://jsr.io/@wuespace)\n[![JSR](https://jsr.io/badges/@wuespace/honolate)](https://jsr.io/@wuespace/honolate)\n[![JSR Score](https://jsr.io/badges/@wuespace/honolate/score)](https://jsr.io/@wuespace/honolate)\n[![Publish Workflow](https://github.com/wuespace/honolate/actions/workflows/publish-jsr.yml/badge.svg)](https://github.com/wuespace/honolate/actions/workflows/publish-jsr.yml)\n\nHonolate is a localization library designed specifically for the Hono web\nframework in Deno. It provides an easy way to manage translations and localize\nyour web applications.\n\n## Getting Started\n\nInstall Honolate via Deno:\n\n```bash\ndeno add jsr:@wuespace/honolate\n```\n\nCreate an `i18n.ts` file to configure your localization settings:\n\n```typescript\n#!/usr/bin/env -S deno run --allow-read --allow-write=./locales/ --allow-env\nimport { initHonolate, InitHonolateOptions, runCLI } from \"@wuespace/honolate\";\n\nconst config = {\n  defaultLanguage: \"en\",\n  languages: {\n    en: import.meta.resolve(\"./locales/en.json\"),\n    de: import.meta.resolve(\"./locales/de.json\"),\n  },\n} satisfies InitHonolateOptions\u003cstring\u003e;\n\n// CLI\nimport.meta.main \u0026\u0026 await runCLI(config, import.meta.dirname ?? Deno.cwd());\n\n// Middleware for Hono\nexport const i18n = await initHonolate(config);\n```\n\nRun the script to initialize your localization files:\n\n```bash\n./i18n.ts\n```\n\nThis will create a `locales` directory with `en.json` and `de.json` files. When\nadded terms in your code, you can re-run the script to update the localization\nfiles.\n\n## Usage\n\n### Using Honolate Middleware in Hono\n\nImport the `i18n` middleware and use it in your Hono application:\n\n```typescript\nimport { Hono } from \"@hono/hono\";\nimport { jsxRenderer } from \"@hono/hono/jsx-renderer\";\nimport { i18n } from \"./i18n.ts\";\n\nconst app = new Hono()\n  .use(jsxRenderer(), i18n)\n  .get(\"/\", (c) =\u003e {\n    // [...]\n  });\n\nDeno.serve(app);\n```\n\n### Eager strings\n\nYou can use eager strings for immediate translation:\n\n```typescript\nimport { t } from \"@wuespace/honolate\";\n\nc.render(\n  \u003cdiv\u003e\n    \u003ch1\u003e{t`Hello world!`}\u003c/h1\u003e\n    \u003cp\u003e{t`We can also use variables like ${new Date()}.`}\u003c/p\u003e\n  \u003c/div\u003e,\n);\n```\n\n### Lazy strings\n\nSometimes, you need to define strings outside of a component context. In this\ncase, you can use lazy strings:\n\n```typescript\nimport { lt } from \"@wuespace/honolate\";\n\nexport const greeting = lt`Hello world!`;\n```\n\nLater, inside a component, you can resolve the lazy string using the `t`\nfunction:\n\n```typescript\nimport { t } from \"@wuespace/honolate\";\nimport { greeting } from \"./greeting.ts\";\n\nc.render(\n  \u003cdiv\u003e\n    \u003ch1\u003e{t(greeting)}\u003c/h1\u003e\n  \u003c/div\u003e,\n);\n```\n\n### Updating localization files\n\nWhenever you add new terms to your code, you can update the localization files\nby re-running the `i18n.ts` script:\n\n```bash\n./i18n.ts\n```\n\nThis will scan your code for new terms and add them to the respective locale\nfiles.\n\nNote that the middleware automatically loads the localization files on startup,\nso you can just edit the JSON files, restart your application, and see the\nchanges immediately.\n\n## About the name\n\nThe name \"Honolate\" is a combination of \"Hono\" and \"translate\", reflecting its\npurpose as a localization library for the Hono framework. It also is a play on\nthe fact that lazy strings are only translated when needed (late), allowing for\na more powerful and flexible localization approach.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuespace%2Fhonolate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwuespace%2Fhonolate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuespace%2Fhonolate/lists"}