@aquafadas/gulp-smartling

Gulp.js tasks dedicated to the synchronization of translations with the Smartling service.

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
50Nov 4, 2016May 6, 2016Minified + gzip package size for @aquafadas/gulp-smartling in KB

Readme

Gulp-Smartling

Release License Downloads Dependencies Code quality Build

Gulp.js tasks dedicated to the synchronization of translations with the Smartling service, based on the File API v1.

Getting Started

If you haven't used Gulp.js before, be sure to check out the related documentation, as it explains how to create a gulpfile.js as well as install and use plugins. Once you're familiar with that process, you may install the provided Gulp tasks with this command:

$ npm install --save-dev @aquafadas/gulp-smartling

Once the build tasks have been installed, they may be enabled inside your gulpfile.js.

Tasks

All file-based tasks require three properties:

  • apiKey: string : The Smartling API key.
  • fileURI: string : A value that uniquely identifies the remote file.
  • projectId: string : The project identifier.

The other properties are optional.

Download the message translations from the Smartling service

This task takes a file pattern as input, indicating the target path of the downloaded files. The {{locale}} placeholder will be replaced by the locale of each file.

const gulp = require('gulp');
const smartling = require('@aquafadas/gulp-smartling');

gulp.task('i18n:download', smartling.download('path/to/i18n/{{locale}}.json', {
  apiKey: 'MyApiKey',  // The Smartling API key.
  fileURI: '/Gulp-Smartling/messages.json', // The file URL.
  includeOriginalStrings: false, // Whether to return the original string when no translation is available.
  locales: ['es-ES', 'fr-FR', 'ja-JP', 'zh-CN'], // The locales to be downloaded (required).
  projectId: 'FooBar', // The project identifier.
  retrievalType: smartling.RetrievalType.PUBLISHED // The retrieval type.
}));

Upload the message source to the Smartling service

This task takes a file path as input, specifying the message source to be uploaded.

const gulp = require('gulp');
const smartling = require('@aquafadas/gulp-smartling');

gulp.task('i18n:upload', smartling.upload('path/to/i18n/en-US.json', {
  apiKey: 'MyApiKey', // The Smartling API key.
  authorize: false, // Whether to authorize the file content in all locales.
  callbackURL: null, // URL of the callback called when the file is 100% published for a locale.
  fileType: smartling.FileType.JSON, // The file type.
  fileURI: '/Gulp-Smartling/messages.json', // The file URL.
  projectId: 'FooBar' // The project identifier.
}));

See Also

License

Gulp-Smartling is distributed under the Apache License, version 2.0.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.