מחבר:
הפנו את עוזר ה-AI המועדף עליכם למסמך הזהChatGPTClaudeDeepSeekGoogle AI modeGeminiPerplexityMistralGrok
שאלו את שאלתכם וקבלו סיכום של המסמך על ידי הפניה לדף הזה ולספק ה-AI שתבחרו
היסטוריית גרסאות
- "Unified documentation for all exports"v8.0.021.1.2026
התוכן של הדף הזה תורגם באמצעות AI.
צפייה בגרסה האחרונה של התוכן המקורי באנגליתעריכת המסמך הזה
אם יש לכם רעיון לשיפור התיעוד הזה, אל תהססו לתרום על ידי הגשת Pull Request ב-GitHub.
קישור GitHub לתיעודנוצר:2026-01-21עדכון אחרון:2026-01-21
העתקה
העתקת ה-Markdown של המסמך ללוח
fastify-intlayer Package
The fastify-intlayer package provides a plugin for Fastify applications to handle internationalization. It detects the user's locale and decorates the request object.
Installation
bash
העתקת קוד
העתקת הקוד ללוח
Exports
Plugin
Import:
tsx
העתקת קוד
העתקת הקוד ללוח
הצגת כל תוכן הטבלה
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Function | Description | Related Doc |
|---|---|---|
intlayer | Fastify plugin that integrates Intlayer into your Fastify application. Handles locale detection from storage (cookies, headers), decorates the request object with intlayer data containing t, getIntlayer, and getDictionary, and sets up CLS namespace for programmatic access during the request lifecycle. | intlayer |
Functions
Import:
tsx
העתקת קוד
העתקת הקוד ללוח
הצגת כל תוכן הטבלה
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Function | Description | Related Doc |
|---|---|---|
t | Global translation function that retrieves content for the current locale in Fastify. Utilizes CLS (Async Local Storage) and must be used within a request context managed by the intlayer plugin. Can also be accessed via req.intlayer.t. | 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 req.intlayer.getIntlayer. | - |
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 req.intlayer.getDictionary. | - |
