FBT

A JavaScript Internationalization Framework

README

Twitter Follow Discord Chat Facebook Group

FBT


FBT is an internationalization framework for JavaScript designed to be not just powerful and flexible, but also simple and intuitive.
It helps with the following:
Organizing your source text for translation
Composing grammatically correct translatable UI
Eliminating verbose boilerplate for generating UI

Online Resources



Examples


Requirements


Building the fbt library

  1. ```
  2. git clone git@github.com:facebook/fbt.git
  3. cd fbt
  4. yarn install
  5. ```

NOTE: if you make changes to the fbt runtime that you'd like to
test in the demo-app, be sure to run this command to rebuild the JS code:

  1. ```
  2. yarn build-runtime
  3. ```

Using fbt

See how to use the source directly with Babel and Webpack in our demo-app.

How FBT works

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

Join the fbt community


See the CONTRIBUTING file for how to help out.

Change log


List of npm modules published from this repo:


- babel-plugin-fbt (build-time / server-side)
  - See package.json
- babel-plugin-fbt-runtime (server-side)
  - See package.json
  - See package.json
- fb-babel-plugin-utils (server-side, used bybabel-plugin-fbt-runtime)
  - See package.json
- fbt (client-side)
  - See package.json
- fb-tiger-hash (build-time)
  - See package.json
  - See package.json
  - See package.json
- react-native-fbt (build-time)
  - See package.json

License

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