⬆️ Actualiza la versión de fluent_templates
This commit is contained in:
parent
c6800e4387
commit
190b685431
3 changed files with 13 additions and 19 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -1251,9 +1251,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fluent-template-macros"
|
name = "fluent-template-macros"
|
||||||
version = "0.11.0"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "007d176e568a4f73ad4225df02aa29ccfecffd8eda31ce78da0bc8b4b310f20a"
|
checksum = "98a7b1d2fc1d7edcd008dd871aea0309be4f8ecfd4fa0388a8f261c6798ab138"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"flume",
|
"flume",
|
||||||
"ignore",
|
"ignore",
|
||||||
|
|
@ -1266,9 +1266,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fluent-templates"
|
name = "fluent-templates"
|
||||||
version = "0.11.0"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "74f22f61b2c8551163ea13c16a381484e5360b089401c6e47c4bfcf6b62bb7ac"
|
checksum = "600669b30905c0c6d69fe3bb897be7ea535b2c904c0c7a6546ada888b0542dbf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fluent-bundle",
|
"fluent-bundle",
|
||||||
"fluent-langneg",
|
"fluent-langneg",
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ tracing-appender = "0.2.3"
|
||||||
tracing-subscriber = { version = "0.3.19", features = ["json", "env-filter"] }
|
tracing-subscriber = { version = "0.3.19", features = ["json", "env-filter"] }
|
||||||
tracing-actix-web = "0.7.15"
|
tracing-actix-web = "0.7.15"
|
||||||
|
|
||||||
fluent-templates = "0.11.0"
|
fluent-templates = "0.12.0"
|
||||||
unic-langid = { version = "0.9.5", features = ["macros"] }
|
unic-langid = { version = "0.9.5", features = ["macros"] }
|
||||||
|
|
||||||
actix-web = "4.9.0"
|
actix-web = "4.9.0"
|
||||||
|
|
|
||||||
|
|
@ -242,20 +242,14 @@ impl L10n {
|
||||||
match &self.op {
|
match &self.op {
|
||||||
L10nOp::None => None,
|
L10nOp::None => None,
|
||||||
L10nOp::Text(text) => Some(text.to_owned()),
|
L10nOp::Text(text) => Some(text.to_owned()),
|
||||||
L10nOp::Translate(key) => {
|
L10nOp::Translate(key) => self.locales.try_lookup_with_args(
|
||||||
if self.args.is_empty() {
|
langid,
|
||||||
self.locales.try_lookup(langid, key)
|
key,
|
||||||
} else {
|
&self.args.iter().fold(HashMap::new(), |mut arg, (k, v)| {
|
||||||
self.locales.try_lookup_with_args(
|
arg.insert(k.to_string().into(), v.to_owned().into());
|
||||||
langid,
|
arg
|
||||||
key,
|
}),
|
||||||
&self.args.iter().fold(HashMap::new(), |mut args, (k, v)| {
|
),
|
||||||
args.insert(k.to_string(), v.to_owned().into());
|
|
||||||
args
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue