yola / gulp-static-i18n

Gulp plugin for internationalization of static assets.
MIT License
5 stars 8 forks source link

Extend to search and parse multiple message directories #5

Closed euwest closed 9 years ago

euwest commented 9 years ago

allows for passing localeDirs(an array of paths to directories containing locale directories with po files in them) to create message dictionaries by merging same-language pos.

example:


var options = {
    localeDirs: [
        'locale', 
        'node_modules/some-module/locale',
        'bower_components/some-component/locale'
    ]
};

gulp.task('translate', function(){
  return gulp.src('collected_static')
    .pipe(statici18n(options));
});

the first directory in localeDirs is treated as the canonical source, which means the languages the app is translated into are derived from the contents of this directory, and the messages from .po files in it are extended but not overwritten by proceeding directories.

euwest commented 9 years ago

@beck

euwest commented 9 years ago

:bell:

beck commented 9 years ago

:+1: