Creation:2026-01-29Last update:2026-01-29
Reference this doc to your favorite AI assistantChatGPTClaudeDeepSeekGoogle AI modeGeminiPerplexityMistralGrok
Ask your question and get a summary of the document by referencing this page and the AI provider of your choice
Version History
- "Unified documentation for all exports"v8.0.01/29/2026
Edit this doc
If you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy
Copy doc Markdown to clipboard
hono-intlayer Package
The hono-intlayer package provides a middleware for Hono applications to handle internationalization. It detects the user's locale and populates the context object.
Installation
Exports
Middleware
Import:
Show all table content
Open the table in a modal to view all data content clearly
| Function | Description | Related Doc |
|---|---|---|
intlayer | Hono middleware that integrates Intlayer into your Hono application. Handles locale detection from storage (cookies, headers), populates the context with t, getIntlayer, and getDictionary, and sets up CLS namespace for programmatic access during the request lifecycle. | intlayer |
Functions
Import:
Show all table content
Open the table in a modal to view all data content clearly
| Function | Description | Related Doc |
|---|---|---|
t | Global translation function that retrieves content for the current locale in Hono. Utilizes CLS (Async Local Storage) and must be used within a request context managed by the intlayer middleware. Can also be accessed via context. | translation |
getIntlayer | Retrieves a dictionary by its key from the generated declaration and returns its content for the specified locale. Optimized version of getDictionary. Uses CLS to access request context. Can also be accessed via context. | - |
getDictionary | Processes dictionary objects and returns content for the specified locale. Processes t() translations, enumerations, markdown, HTML, etc. Uses CLS to access request context. Can also be accessed via context. | - |