gulp-i1337n
Static i18n for Gulp! :fire:
Last updated 2 years ago by oreqizer .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-i1337n 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

7 Versions

  • 1.0.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 15
Dependencies (6)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |