שאלו את שאלתכם וקבלו סיכום של המסמך על ידי הפניה לדף הזה ולספק ה-AI שתבחרו
היסטוריית גרסאות
- "Unified documentation for all exports"v9.5.519.9.2026
התוכן של הדף הזה תורגם באמצעות AI.
צפייה בגרסה האחרונה של התוכן המקורי באנגליתאם יש לכם רעיון לשיפור התיעוד הזה, אל תהססו לתרום על ידי הגשת Pull Request ב-GitHub.
קישור GitHub לתיעודהעתקת ה-Markdown של המסמך ללוח
remix-intlayer Package
The remix-intlayer package provides the necessary tools to integrate Intlayer into Remix 3 applications. Built entirely on web standards (Request, Response, Headers, and URL), it offers a router middleware for locale-based routing and internal rewrites, context storage, hooks, and formatting utilities for seamless multilingual content management.
Installation
העתקת הקוד ללוח
Exports
Middleware
Import:
העתקת הקוד ללוח
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Function | Description | Related Doc |
|---|---|---|
intlayer | Remix 3 router middleware that handles locale-based routing (redirects and internal rewrites), resolves the request locale, persists it in cookies/headers, and establishes the request context scope. | intlayer |
Context
Import:
העתקת הקוד ללוח
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Export | Type | Description | Related Doc |
|---|---|---|---|
Intlayer | ContextKey | RequestContext key holding the IntlayerState (locale, defaultLocale, availableLocales) for the current request. | Intlayer |
INTLAYER_CONTEXT_PROPERTY | string | Property name ('intlayer') installed directly on the request context, allowing access via context.intlayer as well as context.get(Intlayer). | - |
Hooks
Import:
העתקת הקוד ללוח
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Hook | Description | Related Doc |
|---|---|---|
useIntlayer | Picks one dictionary by its key and returns its content for the locale of the request being handled. Automatically reads from the request context / storage. | useIntlayer |
useDictionary | Transforms an imported dictionary object and returns its content for the current request locale. Supports selector overrides. | useDictionary |
useLocale | Returns the resolved locale of the current request, along with the configured defaultLocale and availableLocales. | useLocale |
Utilities
Import:
העתקת הקוד ללוח
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Function | Description | Related Doc |
|---|---|---|
createLocaleRouting | Pure function that computes locale routing decisions (redirect, rewrite, or pass) given a request, configuration, and options. | - |
getIntlayerState | Reads the current IntlayerState (locale, defaultLocale, availableLocales) from the AsyncLocalStorage request scope outside of React components. | - |
Formatters (remix-intlayer/format)
Import:
העתקת הקוד ללוח
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Hook | Description |
|---|---|
useIntl | Returns an Intl instance bound to the request locale with caching and subscription capabilities. |
useDate | Returns a date formatting function pre-bound to the request locale (Intl.DateTimeFormat). |
useNumber | Returns a number formatting function pre-bound to the request locale (Intl.NumberFormat). |
useCurrency | Returns a currency formatting function pre-bound to the request locale. |
usePercentage | Returns a percentage formatting function pre-bound to the request locale. |
useRelativeTime | Returns a relative time formatting function pre-bound to the request locale (Intl.RelativeTimeFormat). |
useList | Returns a list formatting function pre-bound to the request locale (Intl.ListFormat). |
useUnit | Returns a unit formatting function pre-bound to the request locale. |
useCompact | Returns a compact number formatting function pre-bound to the request locale (e.g. 1.5K). |
HTML Utilities (remix-intlayer/html)
Import:
העתקת הקוד ללוח
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Export | Type | Description |
|---|---|---|
renderHTML | Function | Standalone utility function to render HTML nodes outside of UI. |
useHTML | Hook | Hook to get the HTML provider context and configuration. |
useHTMLRenderer | Hook | Hook to obtain a pre-configured HTML renderer function. |
Markdown Utilities (remix-intlayer/markdown)
Import:
העתקת הקוד ללוח
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Export | Type | Description |
|---|---|---|
compileMarkdown | Function | Compiles markdown strings into structured representation. |
renderMarkdown | Function | Renders markdown content into output nodes. |
parseMarkdown | Function | Parses raw markdown content into an AST. |
useMarkdown | Hook | Hook to get the markdown provider context. |
useMarkdownRenderer | Hook | Hook to obtain a pre-configured Markdown renderer function. |
Types
Import:
העתקת הקוד ללוח
פתיחת הטבלה בחלון כדי לראות את כל תוכן הנתונים בבירור
| Type | Description |
|---|---|
IntlayerState | The state object holding locale, defaultLocale, and availableLocales stored in the Remix request context. |
IntlayerMiddlewareOptions | Configuration options passed to the intlayer() middleware. |
LocaleRoutingOptions | Options customizing locale prefixing, detection, and redirects. |
LocaleRoutingAction | Discriminated union representing the routing decision: redirect, rewrite, or pass. |
LocaleRoutingRequest | Minimal request representation required by createLocaleRouting. |
UseLocaleResult | Return type of useLocale(), containing locale, defaultLocale, and availableLocales. |
