This is a gulp task for the csv-locales module which creates json files with i18n locales for Google Chrome extensions and applications from a CSV file.
npm install --save-dev gulp-csv-locales
To create locales use a CSV file which generated from a spreadsheet with this structure.
var csvLocales = require('gulp-csv-locales');
gulp.task('csvLocales', function () {
return csvLocales({
csvPath: 'tmp/locales.csv',
dirPath: 'tmp/_locales',
csvParse: {}
});
});
csvPath
- a path to the CSV file with locales.dirPath
- a path to the target directory. If it doesn't exist, it will be created.csvParse
— a list of options for the CSV parser.