FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    GlobalizationService

    struct · ferroui-protranslate-core · v0.5.0

    struct GlobalizationService
    

    View source

    Members

    new

    fn new(translations: TranslationService) -> Self
    

    Uses the translation service's culture source, so lookup and display state cannot accidentally diverge through two unrelated culture services.

    Source

    with_services

    fn with_services(translations: TranslationService, region_provider: Rc<dyn RegionProfileProvider>, resolver: Rc<dyn MeasurementSystemResolver>, converter: Rc<dyn UnitConversionService>, formatter: Rc<dyn LocalizedUnitFormatter>) -> Self
    

    Source

    cultures

    fn cultures(self: &Self) -> CultureService
    

    Source

    translations

    fn translations(self: &Self) -> TranslationService
    

    Source

    unit_converter

    fn unit_converter(self: &Self) -> Rc<dyn UnitConversionService>
    

    Source

    unit_formatter

    fn unit_formatter(self: &Self) -> Rc<dyn LocalizedUnitFormatter>
    

    Source

    current_culture

    fn current_culture(self: &Self) -> Culture
    

    Source

    flow_direction

    fn flow_direction(self: &Self) -> TextFlowDirection
    

    Source

    set_culture

    fn set_culture(self: &Self, culture: Culture) -> bool
    

    Source

    get_string

    fn get_string(self: &Self, key: &str) -> Result<LocalizedString, TranslationError>
    

    Source

    region_profile

    fn region_profile(self: &Self) -> Result<RegionProfile, TranslationError>
    

    Source

    measurement_system_profile

    fn measurement_system_profile(self: &Self) -> Result<MeasurementSystemProfile, TranslationError>
    

    Source

    measurement_system

    fn measurement_system(self: &Self) -> Result<MeasurementSystem, TranslationError>
    

    Source

    is_metric

    fn is_metric(self: &Self) -> Result<bool, TranslationError>
    

    Source

    set_region_override

    fn set_region_override(self: &Self, region: RegionProfile) -> bool
    

    Source

    clear_region_override

    fn clear_region_override(self: &Self) -> bool
    

    Source

    set_measurement_system_override

    fn set_measurement_system_override(self: &Self, system: MeasurementSystem) -> bool
    

    Source

    clear_measurement_system_override

    fn clear_measurement_system_override(self: &Self) -> bool
    

    Source

    convert_measurement

    fn convert_measurement(self: &Self, value: f64, source: MeasurementUnit) -> Result<MeasurementValue, TranslationError>
    

    Source

    format_measurement

    fn format_measurement(self: &Self, value: f64, unit: MeasurementUnit, format: Option<&str>) -> Result<String, TranslationError>
    

    Source

    format_measurement_for_profile

    fn format_measurement_for_profile(self: &Self, value: f64, source: MeasurementUnit, format: Option<&str>) -> Result<String, TranslationError>
    

    Source

    subscribe

    fn subscribe(self: &Self, callback: impl Fn(&CultureChangedEventArgs) -> () + 'static) -> Subscription
    

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.