Ask your question and get a summary of the document by referencing this page and the AI provider of your choice
Version History
- "Init doc"v9.5.519/09/2026
The content of this page was translated using an AI.
See the last version of the original content in EnglishIf 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 doc Markdown to clipboard
useDictionary Hook Documentation
The useDictionary hook transforms an imported or inline dictionary object and returns its content resolved for the current request's locale in Remix 3 applications.
Unlike useIntlayer, which resolves dictionaries by their string key from the global dictionary registry, useDictionary accepts a dictionary object directly.
Usage
Copy the code to the clipboard
You can also pass inline dictionaries defined with t():
Copy the code to the clipboard
Parameters
Copy the code to the clipboard
dictionary: A dictionary object or qualified dictionary group.localeOrSelector(optional): A specific locale or selector object ({ item },{ variant }, optionally withlocale).
Description
The hook performs the following tasks:
- Locale Detection: Reads the active request locale from the
AsyncLocalStoragestore created by theintlayer()middleware. - Content Resolution: Evaluates translations (
t()), enumerations, conditions, and nested structures according to the resolved locale. - Selector Processing: Applies any item or variant selectors specified in the arguments.
