CultureService
struct · ferroui-protranslate-core · v0.5.0
struct CultureService
Explicit, application-scoped culture state. Does not mutate any process locale.
Members
newsnapshotcurrent_culturecurrent_ui_cultureflow_directioncurrent_regionis_metricset_culture_nameset_cultureset_culturessubscribesubscriber_count
new
fn new(culture: Culture) -> Self
snapshot
fn snapshot(self: &Self) -> CultureSnapshot
current_culture
fn current_culture(self: &Self) -> Culture
current_ui_culture
fn current_ui_culture(self: &Self) -> Culture
flow_direction
fn flow_direction(self: &Self) -> TextFlowDirection
current_region
fn current_region(self: &Self) -> Result<RegionProfile, TranslationError>
Region and measurement metadata follow the formatting culture, while text direction follows the UI culture.
is_metric
fn is_metric(self: &Self) -> Result<bool, TranslationError>
set_culture_name
fn set_culture_name(self: &Self, name: &str) -> Result<bool, TranslationError>
set_culture
fn set_culture(self: &Self, culture: Culture) -> bool
set_cultures
fn set_cultures(self: &Self, culture: Culture, ui_culture: Culture) -> bool
subscribe
fn subscribe(self: &Self, callback: impl Fn(&CultureChangedEventArgs) -> () + 'static) -> Subscription
subscriber_count
fn subscriber_count(self: &Self) -> usize
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherClone
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.