Skip to main content

Crate ferroui_protranslate_core

Crate ferroui_protranslate_core 

Source
Expand description

Framework-independent, application-scoped localization and globalization.

Services are cheap Rc handles, intentionally bound to the owning thread. Callbacks run synchronously after state changes, without internal borrows. Dropping a subscription disconnects it, and observable strings hold services without services retaining their observers.

Structs§

CallbackTranslationProvider
Host bridge for resource managers, localizer services, embedded stores, and other application providers. Ok(None) is a miss; Ok(Some("")) is a hit. Hosts remain responsible for calling TranslationService::refresh after changing external data when already-bound values must refresh immediately.
CompositeTranslationProvider
Ordered, composable providers. Provider failures remain in result diagnostics even if a later provider successfully resolves the value.
Culture
Canonical Unicode BCP-47 culture identifier. The empty name is invariant.
CultureChangedEventArgs
CultureService
Explicit, application-scoped culture state. Does not mutate any process locale.
CultureSnapshot
DefaultLocalizedUnitFormatter
DefaultMeasurementSystemResolver
DefaultRegionProfileProvider
DefaultUnitConversionService
GlobalizationService
InMemoryTranslationProvider
LocalizedDateTime
A Gregorian instant with an explicit UTC offset, suitable for FormatArgument.
LocalizedNaiveDateTime
A wall-clock date/time with no inferred machine time zone. new preserves an unspecified value; utc explicitly identifies the value as UTC.
LocalizedString
MeasurementSystemProfile
MeasurementValue
ObservableLocalizedSnapshot
One coherent observation, including the resolved resource metadata and the independent UI and formatting cultures used to produce its display value.
ObservableLocalizedString
ProTranslateDiagnostic
RegionProfile
Immutable region metadata. Explicit profiles let hosts supply application or user overrides without changing culture, process state, or compiled CLDR data.
Subscription
Disconnects its callback on drop. Keep this value while observing a service.
TranslationCacheOptions
TranslationFallbackOptions
TranslationService

Enums§

FormatArgument
MeasurementSystem
MeasurementUnit
MeasurementUnitCategory
ProTranslateDiagnosticKind
ProTranslateDiagnosticSeverity
TextFlowDirection
TranslationError
A recoverable error from culture parsing, providers, formatting, or units.
TranslationFormatFailureBehavior
TranslationProviderFailureBehavior

Traits§

LocalizedFormat
Extension point for application values (including dates, money, and domain types). It preserves typed formatting without reflection or string coercion.
LocalizedUnitFormatter
MeasurementSystemResolver
ProTranslateDiagnosticSink
RegionProfileProvider
TranslationProvider
A provider performs one exact-culture lookup; the service owns fallback. Empty values are successful translations. Failures are distinct from misses.
UnitConversionService

Functions§

format_composite
Composite formatting with positional arguments, alignment and escaped braces. Alignment counts UTF-16 code units to preserve the source format contract.
placeholder_indexes
Validate the composite grammar and return sorted, distinct argument indexes.
required_argument_count
validate_translation_key
Validate a resource key at a provider boundary, including direct lookups that do not pass through a translation service.