Update dependencies
This commit is contained in:
parent
78ca4b6a09
commit
033e9982ea
|
@ -9,7 +9,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "bc4d7142005e2066e4844caf9f271b93fc79836ee96ec85057b8c109687e629a"
|
||||
dependencies = [
|
||||
"fluent-bundle",
|
||||
"unic-langid 0.9.0",
|
||||
"unic-langid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -25,7 +25,7 @@ dependencies = [
|
|||
"rustc-hash",
|
||||
"self_cell",
|
||||
"smallvec",
|
||||
"unic-langid 0.9.0",
|
||||
"unic-langid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -34,7 +34,7 @@ version = "0.2.0"
|
|||
dependencies = [
|
||||
"fluent",
|
||||
"fluent-syntax",
|
||||
"unic-langid 0.8.0",
|
||||
"unic-langid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -43,7 +43,7 @@ version = "0.13.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2c4ad0989667548f06ccd0e306ed56b61bd4d35458d54df5ec7587c0e8ed5e94"
|
||||
dependencies = [
|
||||
"unic-langid 0.9.0",
|
||||
"unic-langid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -62,7 +62,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "c310433e4a310918d6ed9243542a6b83ec1183df95dff8f23f87bb88a264a66f"
|
||||
dependencies = [
|
||||
"type-map",
|
||||
"unic-langid 0.9.0",
|
||||
"unic-langid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -72,7 +72,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "b18f988384267d7066cc2be425e6faf352900652c046b6971d2e228d3b1c5ecf"
|
||||
dependencies = [
|
||||
"tinystr",
|
||||
"unic-langid 0.9.0",
|
||||
"unic-langid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -157,31 +157,13 @@ dependencies = [
|
|||
"rustc-hash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unic-langid"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24d81136159f779c35b10655f45210c71cd5ca5a45aadfe9840a61c7071735ed"
|
||||
dependencies = [
|
||||
"unic-langid-impl 0.8.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unic-langid"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73328fcd730a030bdb19ddf23e192187a6b01cd98be6d3140622a89129459ce5"
|
||||
dependencies = [
|
||||
"unic-langid-impl 0.9.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unic-langid-impl"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c43c61e94492eb67f20facc7b025778a904de83d953d8fcb60dd9adfd6e2d0ea"
|
||||
dependencies = [
|
||||
"tinystr",
|
||||
"unic-langid-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -19,5 +19,5 @@ include = [
|
|||
|
||||
[dependencies]
|
||||
fluent = "0.15"
|
||||
unic-langid = "0.8"
|
||||
unic-langid = "0.9"
|
||||
fluent-syntax = "0.11"
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
//! The Fluent class makes it easier to load translation bundles with language fallbacks and to go
|
||||
//! through the most common steps of translating a message.
|
||||
//!
|
||||
use fluent::FluentBundle;
|
||||
use fluent::{FluentArgs, FluentError, FluentResource};
|
||||
use fluent::{FluentArgs, FluentBundle, FluentError, FluentResource};
|
||||
use fluent_syntax::parser::ParserError;
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::HashMap;
|
||||
|
@ -156,7 +155,7 @@ impl FluentErgo {
|
|||
bundle.add_resource(res).map_err(|err| Error::from(err))
|
||||
}
|
||||
Entry::Vacant(e) => {
|
||||
let mut bundle = FluentBundle::new(&[lang]);
|
||||
let mut bundle = FluentBundle::new(vec![lang]);
|
||||
bundle.add_resource(res).map_err(|err| Error::from(err))?;
|
||||
e.insert(bundle);
|
||||
Ok(())
|
||||
|
@ -251,7 +250,7 @@ impl FluentErgo {
|
|||
args: Option<&FluentArgs>,
|
||||
) -> Option<String> {
|
||||
let mut errors = vec![];
|
||||
let pattern = bundle.get_message(msgid).and_then(|msg| msg.value);
|
||||
let pattern = bundle.get_message(msgid).and_then(|msg| msg.value());
|
||||
let res = match pattern {
|
||||
None => None,
|
||||
Some(p) => {
|
||||
|
|
Loading…
Reference in New Issue