# TranslationBindingSource

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

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

```rust
struct TranslationBindingSource
```

A replaceable translation service shared by native bindings and attached targets.

Cloning shares the source, while `set_service` atomically
replaces its service and refreshes existing bindings. The source owns no UI
target, and subscription handles unsubscribe both on disposal and on drop.

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

## Members

- [`new`](#function-new)
- [`service`](#function-service)
- [`set_service`](#function-set_service)
- [`culture`](#function-culture)
- [`formatting_culture`](#function-formatting_culture)
- [`set_culture`](#function-set_culture)
- [`set_cultures`](#function-set_cultures)
- [`translate`](#function-translate)
- [`get_value`](#function-get_value)
- [`is_disposed`](#function-is_disposed)
- [`dispose`](#function-dispose)
- [`refresh`](#function-refresh)
- [`subscriber_count`](#function-subscriber_count)
- [`subscribe`](#function-subscribe)
- [`observe`](#function-observe)
- [`default_source`](#function-default_source)
- [`use_default_source`](#function-use_default_source)

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

### new

```rust
fn new(service: TranslationService) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L43)

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

### service

```rust
fn service(self: &Self) -> TranslationService
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L75)

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

### set_service

```rust
fn set_service(self: &Self, service: TranslationService)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L79)

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

### culture

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

Culture used to select resources and resolve text direction.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L88)

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

### formatting_culture

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

Culture used for numeric, date and measurement formatting.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L93)

<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/binding_source.rs#L97)

<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/binding_source.rs#L101)

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

### translate

```rust
fn translate(self: &Self, key: &str, arguments: &[FormatArgument]) -> Result<String, TranslationError>
```

Direct translation preserves the core missing-key and formatting policies.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L106)

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

### get_value

```rust
fn get_value(self: &Self, key: &str) -> Result<Option<BoxedValue>, TranslationError>
```

The native binding indexer yields UnsetValue for a missing resource so the
binding engine can apply its fallback or the target property's default.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L121)

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

### is_disposed

```rust
fn is_disposed(self: &Self) -> bool
```



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

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

### dispose

```rust
fn dispose(self: &Self)
```

Disconnects this source from its service. Dropping its final clone also
releases the service subscription without requiring explicit disposal.

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

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

### refresh

```rust
fn refresh(self: &Self)
```

Explicitly re-evaluates consumers after application-owned catalog updates.

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

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

### subscriber_count

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

Number of live native consumers, useful for lifecycle diagnostics.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L146)

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

### subscribe

```rust
fn subscribe(self: &Self, handler: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
```

Observes refreshes. A subscription never retains its source.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L151)

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

### observe

```rust
fn observe(self: &Self, key: impl Into<String>, arguments: Vec<FormatArgument>) -> Rc<dyn IObservable<String>>
```

A native observable suitable for FerroUI's typed property bindings.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L163)

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

### default_source

```rust
fn default_source() -> Self
```

The explicitly configured, UI-thread-local default source. Initially an
empty catalog using the framework's current UI culture.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L259)

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

### use_default_source

```rust
fn use_default_source(source: Self)
```

Replaces the ambient source and reconnects existing unscoped consumers.
Independently scoped users of the old source keep their own source alive.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate/binding_source.rs#L265)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `PartialEq`
- `Eq`
- [`INotifyPropertyChanged`](/docs/0.5.0/api/ferroui-base/data/model/use-inotifypropertychanged/)
- [`IDisposable`](/docs/0.5.0/api/ferroui-base/reactive/use-idisposable/)
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
