# TranslationCatalog

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

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

```rust
struct TranslationCatalog
```

An ordered collection of normalized translations and its source language.

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

## Members

- [`name`](#struct_field-name)
- [`source_culture`](#struct_field-source_culture)
- [`entries`](#struct_field-entries)
- [`metadata`](#struct_field-metadata)
- [`add`](#function-add)
- [`cultures`](#function-cultures)
- [`to_dictionary`](#function-to_dictionary)
- [`validate`](#function-validate)
- [`normalize_culture_name`](#function-normalize_culture_name)

<a id="struct_field-name"></a>

### name

```rust
name: Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Formats/model.rs#L83)

<a id="struct_field-source_culture"></a>

### source_culture

```rust
source_culture: Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Formats/model.rs#L84)

<a id="struct_field-entries"></a>

### entries

```rust
entries: Vec<TranslationCatalogEntry>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Formats/model.rs#L85)

<a id="struct_field-metadata"></a>

### metadata

```rust
metadata: std::collections::BTreeMap<String, String>
```

Format-specific document metadata, retained independently of its translations.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Formats/model.rs#L87)

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

### add

```rust
fn add(self: &mut Self, key: impl Into<String>, culture: Option<&str>, value: impl Into<String>) -> &mut TranslationCatalogEntry
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Formats/model.rs#L91)

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

### cultures

```rust
fn cultures(self: &Self) -> Vec<String>
```

Unique, case-insensitively ordered culture tags.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Formats/model.rs#L103)

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

### to_dictionary

```rust
fn to_dictionary(self: &Self, culture: Option<&str>) -> BTreeMap<String, String>
```

Select exactly one culture, preserving the source API's last-entry-wins rule.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Formats/model.rs#L116)

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

### validate

```rust
fn validate(self: &Self) -> Vec<TranslationFormatDiagnostic>
```

Validate record identity without changing the original order or discarding duplicates.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Formats/model.rs#L125)

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

### normalize_culture_name

```rust
fn normalize_culture_name(culture: Option<&str>) -> String
```

Normalize the usual hyphen/underscore BCP-47 spelling without assuming OS locale data.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Formats/model.rs#L148)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `DeserializeOwned`
- `Clone`
- `Debug`
- `Default`
- `Eq`
- `StructuralPartialEq`
- `PartialEq`
- `Serialize`
- `Deserialize<'de>`

## Availability

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