TranslationCatalog
struct · ferroui-protranslate-formats · v0.5.0
struct TranslationCatalog
An ordered collection of normalized translations and its source language.
Members
name
name: Option<String>
source_culture
source_culture: Option<String>
entries
entries: Vec<TranslationCatalogEntry>
metadata
metadata: std::collections::BTreeMap<String, String>
Format-specific document metadata, retained independently of its translations.
add
fn add(self: &mut Self, key: impl Into<String>, culture: Option<&str>, value: impl Into<String>) -> &mut TranslationCatalogEntry
cultures
fn cultures(self: &Self) -> Vec<String>
Unique, case-insensitively ordered culture tags.
to_dictionary
fn to_dictionary(self: &Self, culture: Option<&str>) -> BTreeMap<String, String>
Select exactly one culture, preserving the source API's last-entry-wins rule.
validate
fn validate(self: &Self) -> Vec<TranslationFormatDiagnostic>
Validate record identity without changing the original order or discarding duplicates.
normalize_culture_name
fn normalize_culture_name(culture: Option<&str>) -> String
Normalize the usual hyphen/underscore BCP-47 spelling without assuming OS locale data.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedDeserializeOwnedCloneDebugDefaultEqStructuralPartialEqPartialEqSerializeDeserialize<'de>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.