Creation:2026-01-21Last update:2026-01-21

    svelte-intlayer Package

    The svelte-intlayer package provides the necessary tools to integrate Intlayer into Svelte applications. It includes set-up functions and stores for handling multilingual content.

    Installation

    npm install svelte-intlayer

    Exports

    Setup

    Import:

    import "svelte-intlayer";
    Function Description
    setupIntlayer Function to set up Intlayer in your Svelte application.

    Store

    Import:

    import "svelte-intlayer";
    Store Description
    intlayerStore Svelte store that contains the current Intlayer state.

    Hooks (context)

    Import:

    import "svelte-intlayer";
    Function Description Related Doc
    useIntlayer Based on useDictionary, but injects an optimised version of the dictionary from the generated declaration. -
    useDictionary Processes objects that resemble dictionaries (key, content). It processes t() translations, enumerations, etc. -
    useDictionaryAsync Same as useDictionary, but handles asynchronous dictionaries. -
    useDictionaryDynamic Same as useDictionary, but handles dynamic dictionaries. -
    useLocale Returns the current locale and a function to set it. -
    useRewriteURL Client-side function to manage URL rewrites. Automatically updates the URL if a localised rewrite rule exists. useRewriteURL
    useIntl Returns the Intl object for the current locale. -

    Markdown

    Import:

    import "svelte-intlayer";
    Function Description
    setIntlayerMarkdown Function to set the Markdown context in your Svelte application.