מחבר:
הפנו את עוזר ה-AI המועדף עליכם למסמך הזהChatGPTClaudeDeepSeekGoogle AI modeGeminiPerplexityMistralGrok
שאלו את שאלתכם וקבלו סיכום של המסמך על ידי הפניה לדף הזה ולספק ה-AI שתבחרו
היסטוריית גרסאות
- "Initial documentation"v8.0.030.1.2026
התוכן של הדף הזה תורגם באמצעות AI.
צפייה בגרסה האחרונה של התוכן המקורי באנגליתעריכת המסמך הזה
אם יש לכם רעיון לשיפור התיעוד הזה, אל תהססו לתרום על ידי הגשת Pull Request ב-GitHub.
קישור GitHub לתיעודנוצר:2026-01-30עדכון אחרון:2026-01-30
העתקה
העתקת ה-Markdown של המסמך ללוח
adonis-intlayer Package
The adonis-intlayer package provides a middleware for AdonisJS applications to handle internationalization. It detects the user's locale and provides translation functions.
Installation
bash
העתקת קוד
העתקת הקוד ללוח
Exports
Middleware
The package provides an AdonisJS middleware to handle internationalization.
הצגת כל תוכן הטבלה
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Function | Description | Related Doc |
|---|---|---|
IntlayerMiddleware | AdonisJS middleware that detects the user's locale and populates the request context with Intlayer data. It also sets up a CLS (Async Local Storage) namespace for request lifecycle access, enabling the use of global functions like t, getIntlayer, etc. | intlayer |
Functions
הצגת כל תוכן הטבלה
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Function | Description | Related Doc |
|---|---|---|
t | Translation function that retrieves content for the current locale. Works within the request lifecycle managed by the intlayer middleware. Uses CLS (Async Local Storage) to access request 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. | - |
getDictionary | Processes dictionary objects and returns content for the specified locale. Processes t() translations, enumerations, markdown, HTML, etc. Uses CLS to access request context. | - |
getLocale | Retrieves the current locale from the request context using CLS. | - |
