question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Facebook 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:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Turbo87commented, Jan 11, 2019

@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 😕

0reactions
jasonmitcommented, May 16, 2020

Closing since there hasn’t been activity in awhile.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FBT - An internationalization framework - Meta Open Source
FBT is a framework for internationalizing user interfaces in JavaScript. It is designed to be not only powerful and flexible, but also simple...
Read more >
facebook/fbt: A JavaScript Internationalization Framework
FBT is an internationalization framework for JavaScript designed to be not just powerful and flexible, but also simple and intuitive.
Read more >
FBT - Home - Facebook
Professional audio products crafted in Italy to inspire the world since 1963 Via Soprani, 1, 62019 Recanati, Marche, Italy.
Read more >
fbt - npm
The fbt i18n framework JS runtime. ... Start using fbt in your project by running `npm i fbt`. ... Repository. github.com/facebook/fbt ...
Read more >
facebook/fbt - CodeSandbox
Sign up for free to create unlimited sandboxes0/3 Sandboxes used - Anonymous. facebook / fbt / fbe35a2fd177fcb990a38516d353c77f4b26d913.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found