Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-i18n-add-locales

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-i18n-add-locales

Add placeholder JSON files in target locales for i18n-behavior

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-i18n-add-locales

Add placeholder JSON files for target locales for i18n-behavior

Project template available at polymer-starter-kit-i18n. On Github Pages (https://t2ym.github.io/polymer-starter-kit-i18n)

Features

  • Add placeholder empty JSON files in locales folder for the target custom element
  • <template is="i18n-dom-bind" id="module id"> is searched for id
  • <dom-module id="module id"> is searched for id

Install

    npm install --save-dev gulp-i18n-add-locales

Usage

    var gutil = require('gulp-util');
    var grepContents = require('gulp-grep-contents');
    var size = require('gulp-size');
    
    var i18nAddLocales = require('gulp-i18n-add-locales');

    var config = {
      // list of target locales to add
      locales: gutil.env.targets ? gutil.env.targets.split(/ /) : []
    }

    // Add locales to I18N-ready elements and pages
    gulp.task('locales', function() {
      var elements = gulp.src([ 'app/elements/**/*.html' ], { base: 'app' })
        .pipe(grepContents(/i18n-behavior.html/))
        .pipe(grepContents(/<dom-module /));

      var pages = gulp.src([
          'app/**/*.html',
          '!app/{bower_components,styles,scripts,images,fonts}/**/*'
        ], { base: 'app' })
        .pipe(grepContents(/is=['"]i18n-dom-bind['"]/));

      return merge(elements, pages)
        .pipe(i18nAddLocales(config.locales))
        .pipe(gulp.dest('app'))
        .pipe(size({
          title: 'locales'
        }));
    });

API

i18nAddLocales(locales)

  • locales: Array of String, list of target locales to add their placeholder JSON files

License

BSD-2-Clause

Keywords

FAQs

Package last updated on 03 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc