Author:
    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 setup functions and stores for handling multilingual content.

    Installation

    bash
    npm install svelte-intlayer
    

    Exports

    Setup

    Import:

    tsx
    import "svelte-intlayer";
    
    FunctionDescription
    setupIntlayerFunction to setup Intlayer in your Svelte application.

    Store

    Import:

    tsx
    import "svelte-intlayer";
    
    StoreDescription
    intlayerStoreSvelte store that contains the current Intlayer state.

    Hooks (Context)

    Import:

    tsx
    import "svelte-intlayer";
    
    FunctionDescriptionRelated Doc
    useIntlayerBased on useDictionary, but injects an optimized version of the dictionary from the generated declaration.-
    useDictionaryProcesses objects that look like dictionaries (key, content). It processes t() translations, enumerations, etc.-
    useDictionaryAsyncSame as useDictionary, but handles asynchronous dictionaries.-
    useDictionaryDynamicSame as useDictionary, but handles dynamic dictionaries.-
    useLocaleReturns the current locale and a function to set it.-
    usePathnameReturns the current pathname as a Readable<string> store with the locale segment removed. Reactive to popstate.usePathname
    useRewriteURLClient-side function to manage URL rewrites. Automatically updates the URL if a localized rewrite rule exists.useRewriteURL
    useIntlReturns the Intl object for the current locale.-

    Markdown

    Import:

    tsx
    import "svelte-intlayer";
    
    FunctionDescription
    setIntlayerMarkdownFunction to set the markdown context in your Svelte application.