icapps-translations
Last updated 3 years ago by hoetmaaiers .
MIT · Original npm · Tarball · package.json
$ cnpm install icapps-translations 
SYNC missed versions from official npm registry.

Translations global npm package / .bin

Installation

or add it to your project:

// install globally
$ npm install -g icapps-translations

// add it to your project
$ npm install --save-dev icapps-translations

CLI

Install globally:

$ npm install -g icapps-translations

Now translations is availlable a command. For instructions run:

$ translations help

  Usage: translations [options] [command]

  Commands:

    init            setup a cnofiguration file based on the project type
    import          import translations into this project
    help [cmd]      display help for [cmd]

Run from your project root in order to setup the translations configuration.

$ translations init

  Usage: translations-init [options]

  Options:

    -h, --help           output usage information
    -V, --version        output the version number
    --token [value]      Add apiToken
    --translations-path  Add translations path
    --verbose            get more detailed information on what is happening

Run from your project root in order to import the translations into the matching .json files.

$ translations import

  Usage: translations-import [options]

  Options:

    -t, --token [value]    apiToken authentication token
    --api-url [value]      api url e.g. 'http://server/api'
    --seperate-categories  seperate translations in categories
    --destination [value]  translations destionation path
    --clean                clean import, delete all translations before writing new
    --verbose              get more detailed information on what is happening
    --export-type [value]  define export type. Options: (json, plist). Default: json

Gulp

var gulp               = require('gulp');
var importTranslations = require('./lib').import;
var exec               = require('child_process').exec;

// Import translations
gulp.task('translations:import', function(cb) {
  return importTranslations(
    'http://api-url.dev',
    'XXXXXXXXXXXXXXXXXXXXXX',
    {
      clean: true,
      verbose: true,
      seperateTranslations: true,
    }
  );
});


// List translation files, this task dependends on the import task.
//   If we run this task, the async'ness can be tested.
gulp.task('translations:list', ['translations:import'], function(cb) {
  exec('ls ./src/locales', function(error, stdout, stderr) {
    console.log('stdout: ', stdout);
  });
});

Build the module

$ npm run build

// build and keep watching
$ npm run build:dev

Current Tags

  • 0.0.15                                ...           latest (3 years ago)

12 Versions

  • 0.0.15                                ...           3 years ago
  • 0.0.14                                ...           3 years ago
  • 0.0.13                                ...           3 years ago
  • 0.0.12                                ...           3 years ago
  • 0.0.11                                ...           3 years ago
  • 0.0.10                                ...           3 years ago
  • 0.0.8                                ...           3 years ago
  • 0.0.7                                ...           3 years ago
  • 0.0.6                                ...           3 years ago
  • 0.0.5                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 12
Last Day 0
Last Week 12
Last Month 0
Dependencies (8)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |