Skip to main content

Crate cranpose_localization

Crate cranpose_localization 

Source
Expand description

§cranpose-localization

Immutable Fluent catalogs, scoped translators, and source extraction for Cranpose. Enable cranpose’s localization feature for tr!, translations!, and ProvideLocalization. The standalone formatter has no UI dependency.

Structs§

Argument
A named value passed to a message without allocating a string for numbers.
Catalog
Immutable, shareable parsed catalogs. Replacing a catalog replaces its cache identity.
DeferredMessage
A message captured outside composition and translated when displayed. Borrowed arguments become owned; cloning a request shares their storage. Use message! to construct one with checked source text and named arguments.
Language
A supported application language and its native display name.
Locale
A validated language tag and optional localization preview.
Localization
Shared application localization used by UI roots, workers, and native services. Each thread retains only its most recently used formatter. Language changes invalidate that formatter; repeated messages do not reconstruct Fluent bundles.
Message
A static message definition emitted by tr! or generated catalog bindings.
Resource
One embedded or application-loaded Fluent resource.
SourceCatalog
Source-language messages shared by generated accessors and parsed on first use.
Translator
A thread-owned formatter with no cross-thread locks during formatting. Construct one from a shared Catalog on each thread that needs translations.

Enums§

FluentValue
Values accepted by generated message accessors, including borrowed text and numbers. The FluentValue enum represents values which can be formatted to a String.
LanguagePreference
A saved application language choice, independent of the current system locale.
LocalizationError
A catalog, locale, or message could not be used.
PreviewMode
A visual stress test applied after message formatting.

Traits§

LanguagePreferenceStore
An application’s storage adapter for its language preference. Native UI providers call these methods on a worker so storage cannot block a frame.