1.0.0 • Published 7 years ago

gulp-i1337n v1.0.0

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

gulp-i1337n

Build Status codecov styled with prettier npm (scoped)

A gulp plugin for static translations. Uses babylon under the hood.

Install

yarn add gulp-i1337n --dev

Usage

const gulp = require('gulp');
const i1337n = require('gulp-i1337n');

gulp.task('default', () =>
  gulp
    .src('src/app.js')
    .pipe(i1337n({ hello: 'World!' }))
    .pipe(gulp.dest('dist'))
);

Turns this:

function greet() {
  console.log(__('hello'));
}

into this:

function greet() {
  console.log('World!');
}

API

Simply pipe the package's export.

i1337n(translations, options)

translations

Your object of translations. Keys are replaced with values. Value must be a string.

options (optional)

Two properties:

  • func (string) - the function name to search for, default __
  • strict (boolean) - should the plugin fail on missing translation

License

MIT

1.0.0

7 years ago

0.1.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago