-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement: Access to attributes #19
Comments
What is |
@marc2332 Sorry. I meant |
@85oski I think your fluent code is just wrong, this works: categories =
{ $cat ->
[main] Main page
[about-me] About me
*[default] Other
} let mut cat = use_signal(|| "main");
rsx!(
p { { t!("categories", cat: *cat.read()) } }
button {
onclick: move |_| cat.set("main"),
"Main"
}
button {
onclick: move |_| cat.set("about-me"),
"About Me"
}
) |
@marc2332 I wanted to use this syntax: https://projectfluent.org/fluent/guide/attributes.html. I wanted to create a navigation bar with an h1 header with the content rsx! {
div {
h1 { {t!("categories")} }
ul {
li {
Link {
to: todo!(),
{t!("categories.main")}
}
}
li {
Link {
to: todo!(),
{t!("categories.about-me")}
}
}
}
}
} |
We don't support an easy access to the attributes, but anyway, you are using the wrong abstraction. Attributes are not variants, and what you want is precisely variants, I suggest you code I provided above |
@marc2332 Okay, thank you. I will try to use the solution you suggested. |
Hi, I have this en.ftl file:
When I try to get the content of e.g.
categories.main
viat!("categories.main")
, I get an error in the console saying that no message with this id was found (message id not found for key: 'categories.main'
).Is there a way to get the content of this translation? Or maybe I'm doing it the wrong way? Thank you in advance
The text was updated successfully, but these errors were encountered: