Giter Club home page Giter Club logo

formatjs-message-extractor's Introduction

formatjs-message-extractor

Extract your messages defined in your React app and auto merge existing translations for defined locales.

Install

First, add this package as development dependency :

$ yarn add -D formatjs-message-extractor

Then, add this following line in "scripts" in your package.json file.

"intl": "formatjs-message-extractor src/lang -l en,fr"

This will create a src/lang directory with a json file for each locale specified by the -l option.

src/lang
├── en.json
└── fr.json

Later, when you have added other messages in your code, this same command will add the missing keys in the existing files and will delete the keys of the messages that no longer exist in your code.

Options

A few options are available :

-l, --locales

This allows you to choose the languages to be translated.

For example, the command:

$ formatjs-message-extractor src/lang -l en,de,it

will create three locales files: en.json, de.json and it.json.

-d, --defaultLocale

This define the locale used in default messages in your code.

By default this is set on en.

formatjs-message-extractor's People

Contributors

alexandretrichot avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.