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