fluent-rs icon indicating copy to clipboard operation
fluent-rs copied to clipboard

Fluent is not approachable for a beginner

Open teohhanhui opened this issue 4 years ago • 3 comments

I cannot find an example putting everything together for a practical implementation. There are 3 disparate examples:

  1. fluent-bundle/examples/simple-app.rs
  2. fluent-fallback/examples/simple-fallback.rs
  3. 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).

teohhanhui avatar Jun 06 '20 15:06 teohhanhui

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?

teohhanhui avatar Jun 06 '20 15:06 teohhanhui

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 :)

zbraniecki avatar Jun 16 '20 01:06 zbraniecki