Facebook's FBT
See original GitHub issueFacebook recently open sourced FBT, their Intl framework.
They are using a very interesting concept: translations are not defined in an external .yml
file and then referenced by a key. Instead the base translation (English) is written in place in the (JSX) template and wrapped in an <fbt>
tag to denote that it is a translatable section. FBT then later transforms and extracts all these usages and generates something similar to our .yml
files.
https://facebookincubator.github.io/fbt/docs/params https://facebookincubator.github.io/fbt/docs/autoparam
This is of course orthogonal to how ember-intl works, but nevertheless very interesting. A system similar to it would very elegantly solve #715.
With Glimmer and Ember’s powerful build system we can do all of this, too. When I can find some time, I’ll start experimenting with it.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:8 (5 by maintainers)
Top GitHub Comments
@buschtoens I’ve had that plan for a long time, but never found the time to implement it. how would you handle nested component invocations in that
<T>
?one way to do it would be to compile the template once per supported locale and then override the templates when a new locale is lazy-loaded in the browser. I assume something like that is possible, but I guess it would require some knowledge of the glimmer internals 😕
Closing since there hasn’t been activity in awhile.