Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gulp-i18n-compile2 with all npm packages installed. Try it out:

var gulpI18nCompile2 = require("gulp-i18n-compile2")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gulp-i18n-compile2 v1.0.3

Compilation of gulp-18n-extract files into language files for aurelia-i18n.

gulp-i18n-compile2

NPM version

This gulp tasks compiles the extract content from gulp-i18n-extract into language json files for Aurelia-i18n .

This task ist part of the i18n toolchain:

  1. [Tag](to be implemented) text nodes in HTML with an i18n key attribute
  2. Extract keys and values
  3. Translate
  4. Compile into language files for i18n like Aurelia-i18n

Installation

Install gulp-i18n-compile2 using npm into your local repository.

npm install gulp-i18n-compile2 --save-dev

Usage

Setup a gulp task i18n-compile.

var gulp = require('gulp');
var i18n_compile = require('gulp-i18n-compile2');

var options = {
    fileName: "translation.json",
    defaultLanguage: "en"
};

gulp.task('i18n-compile', function() {
  return gulp.src("lang/language.json")
             .pipe(i18n_compile(options))
             .pipe(gulp.dest("./locales"));
});

License

Apache 2.0

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free