Skip to content

Commit

Permalink
Update fluent-templates dependency to 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
KokaKiwi committed Dec 23, 2024
1 parent 47cd282 commit c74d39c
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 24 deletions.
50 changes: 41 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/csr-complete/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ path = "src/lib.rs"
[dependencies]
leptos = { version = "0.7", features = ["csr"] }
leptos-fluent = { path = "../../leptos-fluent", features = ["json"] }
fluent-templates = { version = "0.11", default-features = false, features = [
fluent-templates = { version = "0.12", default-features = false, features = [
"macros",
"walkdir"
"walkdir",
] }
console_error_panic_hook = "0"

Expand Down
4 changes: 2 additions & 2 deletions examples/csr-minimal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ path = "src/lib.rs"
[dependencies]
leptos = { version = "0.7", features = ["csr"] }
leptos-fluent = { path = "../../leptos-fluent" }
fluent-templates = { version = "0.11", default-features = false, features = [
fluent-templates = { version = "0.12", default-features = false, features = [
"macros",
"walkdir"
"walkdir",
] }
console_error_panic_hook = "0.1"

Expand Down
6 changes: 3 additions & 3 deletions examples/ssr-hydrate-actix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ leptos_meta = "0.7"
leptos_actix = { version = "0.7", optional = true }
leptos_router = "0.7"
leptos-fluent = { path = "../../leptos-fluent" }
fluent-templates = { version = "0.11", default-features = false, features = [
fluent-templates = { version = "0.12", default-features = false, features = [
"macros",
"walkdir"
"walkdir",
] }
wasm-bindgen = "=0.2.99"

Expand All @@ -35,7 +35,7 @@ ssr = [
"leptos_meta/ssr",
"leptos_router/ssr",
"leptos-fluent/ssr",
"leptos-fluent/actix"
"leptos-fluent/actix",
]

[package.metadata.leptos]
Expand Down
6 changes: 3 additions & 3 deletions examples/ssr-hydrate-axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ leptos_meta = "0.7"
leptos_axum = { version = "0.7", optional = true }
leptos_router = "0.7"
leptos-fluent = { path = "../../leptos-fluent", features = [
"yaml"
"yaml",
], default-features = false }
fluent-templates = { version = "0.11", default-features = false, features = [
fluent-templates = { version = "0.12", default-features = false, features = [
"macros",
"walkdir"
"walkdir",
] }
wasm-bindgen = "=0.2.99"

Expand Down
6 changes: 3 additions & 3 deletions leptos-fluent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ keywords.workspace = true

[dependencies]
leptos-fluent-macros = { path = "../leptos-fluent-macros" }
fluent-templates = { version = ">=0.9", default-features = false, features = [
fluent-templates = { version = ">=0.12", default-features = false, features = [
"macros",
"walkdir"
"walkdir",
] }
leptos = "0.7"
leptos_meta = "0.7"
Expand All @@ -34,7 +34,7 @@ default = []
system = [
"dep:current_locale",
"dep:directories",
"leptos-fluent-macros/system"
"leptos-fluent-macros/system",
]
nightly = ["leptos-fluent-macros/nightly"]
tracing = ["leptos-fluent-macros/tracing", "dep:tracing"]
Expand Down
5 changes: 3 additions & 2 deletions leptos-fluent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ use leptos::{
guards::ReadGuard, use_context, Read, RwSignal, Set, Signal, With,
},
};
use std::borrow::Cow;

/// Direction of the text
#[derive(Debug)]
Expand Down Expand Up @@ -685,7 +686,7 @@ pub fn tr_impl(i18n: I18n, text_id: &str) -> String {
pub fn tr_with_args_impl(
i18n: I18n,
text_id: &str,
args: &std::collections::HashMap<String, FluentValue>,
args: &std::collections::HashMap<Cow<'static, str>, FluentValue>,
) -> String {
let I18n {
language,
Expand Down Expand Up @@ -740,7 +741,7 @@ macro_rules! tr {
$crate::tr_with_args_impl($crate::expect_i18n(), $text_id, &{
let mut map = ::std::collections::HashMap::new();
$(
map.insert($key.to_string(), $value.into());
map.insert($key.into(), $value.into());
)*
map
})
Expand Down

0 comments on commit c74d39c

Please sign in to comment.