svelte-intl
- Purpose: Internationalization library for Svelte 3 apps using format-message .
- Key Features:
- Provides translation and localization utilities for Svelte applications.
- Supports dynamic locale switching and reactive translations.
- Integrates with
format-messagefor message formatting.
- Target Audience: Svelte developers needing i18n (internationalization) support.
- Core API:
translate(or_): A store for translation functions, usable reactively in Svelte templates.translations: Manages available translations withsetandupdatemethods.locale: Store for current locale, with safe update methods (logs errors for invalid locales).locales: Derived store listing available locales from translations.options: Configuresformat-messagebehavior (merges updates).getBrowserLocale: Helper to detect browser language with fallback support.
- Svelte 2 Note: A separate branch exists for Svelte 2 compatibility.
- Example Usage:
<script> import { _ } from 'svelte-intl' export let name = 'John' </script> <h1>{$_('hello', { name })}</h1>
intli18nsveltesveltejsformat-message
Author unavailable
We couldn’t load the author for this library. The library remains visible, but some actions are unavailable.
If you maintain this library, please sign in and claim it so your profile appears here.
Follow actions are hidden until an author profile is available.
Featured Stories
No featured articles.