mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
convert language files from ini to json
This commit is contained in:
parent
6446281254
commit
1f4a171f10
37 changed files with 48 additions and 38 deletions
|
@ -126,16 +126,26 @@ var generateLocaleIndex = function () {
|
|||
return result;
|
||||
}
|
||||
|
||||
var generateLocaleIndexJSON = function () {
|
||||
if (_.isEmpty(locales)) getAllLocales();
|
||||
var result = locales;
|
||||
//result += locales['en']+"\n";
|
||||
_.each(_.keys(locales), function(langcode) {
|
||||
if (langcode != 'en') result[langcode]='/locales/'+langcode+'.json';
|
||||
});
|
||||
return JSON.stringify(result);
|
||||
}
|
||||
|
||||
var root = path.resolve(__dirname+"/../locales");
|
||||
|
||||
getAllLocales();
|
||||
|
||||
_.each(locales, function(translation, langcode) {
|
||||
console.log('escribiendo '+langcode);
|
||||
translation = JSON.stringify(translation);
|
||||
translation = '{"'+langcode+'":'+JSON.stringify(translation)+'}';
|
||||
fs.writeFileSync(root+"/"+langcode+".json", translation, 'utf8');
|
||||
});
|
||||
|
||||
console.log('escribiendo locales.json');
|
||||
fs.writeFileSync(root+"/locales.json", JSON.stringify(locales), 'utf8');
|
||||
console.log('escribiendo localeIndex.json');
|
||||
fs.writeFileSync(root+"/localesIndex.json", generateLocaleIndexJSON(), 'utf8');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue