Crate arb_lib

Source
Expand description

Translate Flutter application resource bundles.

§Examples

Create a translation application resource bundle:

use arb_lib::{Intl, deepl::{DeeplApi, ApiOptions, Lang}};

let api_key: std::env::var("DEEPL_API_KEY").unwrap();
let api = DeeplApi::new(ApiOptions::new(api_key));
let options = TranslationOptions::new(Lang::Fr);
let mut intl = Intl::new("l10n.yaml")?;
let result = intl.translate(&api, options).await?;
println!("{:#?}", result);

Re-exports§

pub use deepl;

Structs§

ArbCache
Cache of template strings used for translations.
ArbEntry
Entry in an application resource bundle map.
ArbFile
Content of an application resource bundle file.
ArbKey
Key in the application resource bundle map.
ArbValue
Value in the application resource bundle map.
FileDiff
Diff of the keys in two language files.
Intl
Internationalization index file.
Placeholders
Collection of placeholder names.
TranslateResult
Translate result.
TranslationOptions
Options for translation.

Enums§

Error
Error type for the library.
Invalidation
Variants for key invalidation.

Type Aliases§

Result
Result type for the library.