INSAgenda / yew-template

A crate to separate your HTML from your Rust code when using Yew
https://crates.io/crates/yew-template
MIT License
39 stars 3 forks source link

Translation support #20

Closed Mubelotix closed 1 year ago

Mubelotix commented 2 years ago

The produced code should look like


    fn t_6517(s: usize, locale: &str) -> &str {
        let default = ["Hello world!"];

        match locale {
            "fr" => if let Some(t) = [Some("Bonjour le monde!")][s] {
                return t;
            },
        }

        return default[s]
    }
    html! {
        <p>
            t_6517(0, locale);
        </p>
    }