gulp-i18n-localize2
v1.2.6
Published
> localization plugin for gulp
Downloads
8
Maintainers
Readme
gulp-i18n-localize 
localization plugin for gulp
Install
$ npm install --save-dev gulp-i18n-localizeUsage
var gulp = require('gulp');
var i18n = require('gulp-i18n-localize');
gulp.task('default', function () {
return gulp.src('src/index.html')
.pipe(i18n({
locales: ['en-US'],
localeDir: './locales'
}))
.pipe(gulp.dest('dist'));
});API
i18n(options)
options
delimeters
Type: array
Default: ['${{', '}}$']
Sets the delimeters to search assets files and replace with translated content.
By default, it will match ${{ and $}}.
delimeter[0] | delimeter[1] | matches
--- | --- | ---
${{ | }}$ | ${{ foo.bar }}$
!{ | }! | !{ foo.bar }!
#{ | }# | #{ foo.bar }#
ignoreErrors
Type: boolean
Sets whether to ignore errors and prevent gulp from failing. This will still log errors to gulp.
localeDir
Type: array
Required
Location of translation files. This is a required field.
locales
Type: array
Default: ['en-US']
Locales to translate, should match localDir subfolders.
defaultLocale
Type: string
Default: undefined
If translation was not found at specific locale, it will try to look at defaultLocale.
schema
Type: string
Default: directory
Sets the schema to be used for naming translated assets.
schema | output name
----------- | -------------
directory | /en-US/index.html
suffix | /index-en-US.html
License
MIT © Filipe Araujo
