33

GitHub - facebookincubator/fbt: A JavaScript Internationalization Framework

 5 years ago
source link: https://github.com/facebookincubator/fbt
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

FBT

FBT is an internationalization framework designed to be both powerful and flexible, but also simple and intuitive. It helps with the following:

  • Organizing your source text for translation
  • Composing grammatically correct translatable UI
  • Source-code bloat from generating similarly constructed UI

Examples

See our demo here

Requirements

Building fbt

git clone [email protected]:facebookincubator/fbt.git;
cd fbt;
yarn install;

Installing fbt

We will make the transform and runtime installable as an npm package soon. Until then, See how to use the source directly with Babel and Webpack in our demo-app:

cd demo-app; # from fbt repo
yarn install;
yarn manifest;
yarn collect-fbts;
yarn translate-fbts;
yarn start;

How FBT works

FBT works by transforming your <fbt> and fbt(...) constructs via Babel plugins. These plugins serve to extract strings from source and lookup translate payloads generated at build-time. FBT creates tables of all possible variations for the given fbt phrase and accesses this at runtime

Full documentation

https://facebookincubator.github.io/fbt

Join the fbt community

See the CONTRIBUTING file for how to help out.

License

FBT is MIT licensed, as found in the LICENSE file.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK