This module creates json files with i18n locales for Google Chrome extensions and applications from a CSV file.
npm install --save csv-locales
To create locales use a CSV file which generated from a spreadsheet with this structure.
You can use it as a grunt task or as a gulp task, or as in example below:
var csvLocales = require('csv-locales');
var params = {
csvPath: 'path/to/the/file/locales.csv',
dirPath: 'path/to/the/target/dir/_locales',
csvParse: {/* CSV parser option or null */}
};
csvLocales(params, function (err) {
if (err) {
throw err;
}
// All done!
});
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.