fluent-rs
fluent-rs copied to clipboard
Fluent is not approachable for a beginner
I cannot find an example putting everything together for a practical implementation. There are 3 disparate examples:
- fluent-bundle/examples/simple-app.rs
- fluent-fallback/examples/simple-fallback.rs
- fluent-resmgr/examples/simple-resmgr.rs
Is it expected that we use all of fluent_bundle
, fluent_langneg
, fluent_fallback
and fluent_resmgr
together? If so, there should be an example showing how all the pieces fit together. If not, there should be explanation of when to use what (and why not).
Of course, there's also the problem that all these "simple" examples are anything but simple. But I realize that's something that's being worked on.
Perhaps the goal could be to have a chapter on l10n in the Rust Book?
Hi. Thank you for the feedback.
Is it expected that we use all of fluent_bundle, fluent_langneg, fluent_fallback and fluent_resmgr together?
Yes. Although you can replace any part - you can provide different language negotiation, different fallbacking and different resource management. Those are just examples.
If so, there should be an example showing how all the pieces fit together. If not, there should be explanation of when to use what (and why not).
I intend to add it once I stablize the higher level APIs a bit more.
Of course, there's also the problem that all these "simple" examples are anything but simple. But I realize that's something that's being worked on.
Good localization system is not easy unfortunately. We're focused on lower level APIs now, and I'm planning to start working on higher level APIs soon.
For now, I recommend looking at https://crates.io/crates/fluent-templates and https://crates.io/crates/fluent-ergonomics
I hope to get to the level of simplicity that the current JS fluent-dom
and fluent-react
have. It'll take a bit :)