mondeja / leptos-fluent

Internationalization framework for Leptos using Fluent
https://mondeja.github.io/leptos-fluent/
MIT License
38 stars 10 forks source link

Unable to use datetime #200

Closed johansmitsnl closed 3 months ago

johansmitsnl commented 3 months ago

In Leptos I use this:

{move_tr!( "locale-date-format", {"date" => post.publish_time.to_string()} )}

And in the translation I have:

locale-date-format = { DATETIME($date, month: "long", year: "numeric", day: "numeric") }

Used from the documentation but I keep getting the error:

error: Translations check failed:
       - Variable "date" defined at `move_tr!("locale-date-format", { ... })` macro call in src/components/site/reviews_google.rs not found in message "locale-date-format" of locale "en".
       - Variable "date" defined at `move_tr!("locale-date-format", { ... })` macro call in src/components/site/reviews_google.rs not found in message "locale-date-format" of locale "nl".
  --> ui/src/console.rs:43:29
   |
43 |         check_translations: "./src/**/*.rs",

Is this an error on my side, because fluent is completely new to me?

mondeja commented 3 months ago

There must surely be a bug in the translations checker.