Dirkjan Ochtman

Results 2027 comments of Dirkjan Ochtman

What browser/device are you on?

I don't think this is a high priority to solve, it seems like an edge case that people probably don't rely on anyway.

Looks like a good start! I wonder if we can simplify a bit, though. Can we make a template more like this? ```rust #[derive(Template)] #[template(path = "i18n.html")] struct UsesI18n

Also, thanks for working on this! I'm very excited to get this in!

I guess my question is, what bits of state (other than the locale) does a `Localizer` need? And will most of these bits of state be per template or globally...

Huh, sorry I missed your responses on this -- are you still interested in working on this? Having reviewed your code a bit more, how about having an Askama-provided type...

Something like this: ```rust #[derive(Template)] #[template(source = "{{ localize(\"hello\", age: 37) }}")] struct UsesI18n

There is currently not. Askama is really two things: a parser for a template language to an AST, and a code generator that transpiles the AST to Rust code. I'd...

What's the use case, BTW? Just the compile time benefits, or actual "dynamic" usage, something else? Another approach could be to run the Askama-generated Rust code through a JIT compiler...

Fair enough. I'm not even sure the interpreting approach could work short of something that can interpret Rust -- I think it would require "flattening" context types into something easier...