2.0.0 • Published 7 years ago

webpack-phraseapp-builder v2.0.0

Weekly downloads
71
License
MIT
Repository
github
Last release
7 years ago

Webpack PhraseAppBuilder Plugin

Webpack plugin for generating translations files from PhraseApp. This plugin uses the download API endpoint from PhraseApp, for further information please see the following link This plugin will run before the Webpack compilation, so the translations are available before the Webpack assertions.

Since this plugin will download the translations before the assertions, is not recommended to use the same path as the output path for Webpack assertions

Install

To install the package run the following command:

  npm install -D webpack-phraseapp-builder

Usage

In your webpack.config.js

var PhraseAppBuilderPlugin = require('webpack-phraseapp-builder');

module.exports = {
    // ...
    plugins: [
      new PhraseAppBuilderPlugin({
        accessToken: 'theAccesTokenId',  // Get your accessToken from PhraseApp
        projectId: 'theProjectId', // Get the project id from PhraseApp
        outputPath: 'path',
        format: 'json' // specify the format from Phraseapp
      })
    ]
};

This will generate translations files in your configured output directory, for example:

// src/translations/es.json

{
  "some.key": "hello",
}

Options:

  • localesId: The locales id from your PhraseApp project.
  • accessToken: The accessToken to authorize the PhraseApp API.
  • outputPath: The path where you want to download the translations.
  • projectId: The project id from PhraseApp from where you want to extract your translations
  • format: The format to download the translations
2.0.0

7 years ago

1.3.0

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago