Skip to main content

Crate sova_i18n

Crate sova_i18n 

Source
Expand description

Two-level i18n for Sova (root + page scopes).

Structs§

AllJsonEnabled
Marker: GET /_i18n/all.json is allowed.
I18n
I18n plugin.
I18nScope
Page scope attached via I18nRouteExt::i18n_scope.
I18nState
Shared runtime used by middleware and I18nExt.
Locale
Locale metadata exposed to the frontend.
LocaleCode
Resolved locale code on the request.
ResolveOptions
Scope
One locale+scope snapshot.
Store
Immutable translation catalog.

Enums§

LocaleSource
Sources checked in order (first match wins).
PrefixMode
How to apply locale path prefixes.

Constants§

ROOT_SCOPE

Traits§

I18nExt
Translate helpers on Request.
I18nRouteExt
Attach an i18n page scope to the last registered route.

Functions§

default_plural
Compatible with nuxt-i18n-micro defaultPlural: forms[count] clamped.
get_by_path
JS getByPath: exact top-level key first (hasOwnProperty), else dotted walk.
interpolate
Replace {token} placeholders; missing tokens stay as {token}.
load_store
Load locales/{lang}.json and locales/pages/{page}/{lang}.json.
localize_path
Build a localized path for locale from an unprefixed path.
localized_url
Absolute URL for a localized path.
mount_localized
Mount routes under locale prefixes onto app_router.
negotiate_accept_language
Parse Accept-Language and pick the best known locale.
resolve_server_locale
strip_locale_prefix
Strip a leading /{locale} segment when it matches a known locale code.
template_fn
Build a MiniJinja callable t(...) for the current request.

Type Aliases§

PluralFn
Split one|two|many and pick a form.