Creation:2026-01-21Last update:2026-01-21
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.021/01/2026
The content of this page was translated using an AI.
See the last version of the original content in EnglishEdit 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
express-intlayer Package
The express-intlayer package provides a middleware for Express applications to handle internationalisation. It detects the user's locale and provides translation functions.
Installation
Exports
Middleware
Import:
Show all table content
Open the table in a modal to view all data content clearly
| Function | Description | Related documentation |
|---|---|---|
intlayer | Express middleware that detects the user's locale and populates res.locals with Intlayer data. Performs locale detection from cookies and headers, injects t, getIntlayer and getDictionary into res.locals, and sets up a CLS namespace for request lifecycle access. | intlayer |
Functions
Import:
Show all table content
Open the table in a modal to view all data content clearly
| Function | Description | Related Doc |
|---|---|---|
t | Translation function that retrieves content for the current locale. Operates within the request lifecycle managed by the intlayer middleware. Uses CLS (Async Local Storage) to access the request context. | translation |
getIntlayer | Retrieves a dictionary by its key from the generated declaration and returns its content for the specified locale. Optimised version of getDictionary. Uses CLS to access the request context. | - |
getDictionary | Processes dictionary objects and returns content for the specified locale. Processes t() translations, enumerations, Markdown, HTML, etc. Uses CLS to access the request context. | - |