# CultureService

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-protranslate-core/struct-cultureservice/

**struct** · [`ferroui-protranslate-core`](/docs/0.5.0/api/ferroui-protranslate-core/) · v0.5.0

```rust
struct CultureService
```

Explicit, application-scoped culture state. Does not mutate any process locale.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L116)

## Members

- [`new`](#function-new)
- [`snapshot`](#function-snapshot)
- [`current_culture`](#function-current_culture)
- [`current_ui_culture`](#function-current_ui_culture)
- [`flow_direction`](#function-flow_direction)
- [`current_region`](#function-current_region)
- [`is_metric`](#function-is_metric)
- [`set_culture_name`](#function-set_culture_name)
- [`set_culture`](#function-set_culture)
- [`set_cultures`](#function-set_cultures)
- [`subscribe`](#function-subscribe)
- [`subscriber_count`](#function-subscriber_count)

<a id="function-new"></a>

### new

```rust
fn new(culture: Culture) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L118)

<a id="function-snapshot"></a>

### snapshot

```rust
fn snapshot(self: &Self) -> CultureSnapshot
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L127)

<a id="function-current_culture"></a>

### current_culture

```rust
fn current_culture(self: &Self) -> Culture
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L130)

<a id="function-current_ui_culture"></a>

### current_ui_culture

```rust
fn current_ui_culture(self: &Self) -> Culture
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L133)

<a id="function-flow_direction"></a>

### flow_direction

```rust
fn flow_direction(self: &Self) -> TextFlowDirection
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L136)

<a id="function-current_region"></a>

### current_region

```rust
fn current_region(self: &Self) -> Result<RegionProfile, TranslationError>
```

Region and measurement metadata follow the formatting culture, while
text direction follows the UI culture.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L141)

<a id="function-is_metric"></a>

### is_metric

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L144)

<a id="function-set_culture_name"></a>

### set_culture_name

```rust
fn set_culture_name(self: &Self, name: &str) -> Result<bool, TranslationError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L147)

<a id="function-set_culture"></a>

### set_culture

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L153)

<a id="function-set_cultures"></a>

### set_cultures

```rust
fn set_cultures(self: &Self, culture: Culture, ui_culture: Culture) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L156)

<a id="function-subscribe"></a>

### subscribe

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L171)

<a id="function-subscriber_count"></a>

### subscriber_count

```rust
fn subscriber_count(self: &Self) -> usize
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Core/culture.rs#L174)

## 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](/docs/0.5.0/api/).
