first merge to main 🚀 #71

Manually merged
philipp merged 491 commits from dev into main 2021-02-19 17:03:06 +00:00
Showing only changes of commit 947482c1b5 - Show all commits

View File

@ -1,11 +1,16 @@
const fs = require('fs'); const fs = require('fs');
const unordered = JSON.parse(fs.readFileSync('src/locales/de.json')); // get all language files
const files = fs.readdirSync('./src/locales/');
const ordered = Object.keys(unordered).sort().reduce((obj, key) => { files.forEach((f) => {
obj[key] = unordered[key]; // read file as object
return obj; const unordered = JSON.parse(fs.readFileSync(`src/locales/${f}`));
}, {}); // order object by keys alpabetically A-Z
const ordered = Object.keys(unordered).sort().reduce((obj, key) => {
// console.log(JSON.stringify(ordered)); obj[key] = unordered[key];
const out = JSON.stringify(ordered, 0, 4); return obj;
fs.writeFileSync('src/locales/de.json', out); }, {});
// format output as json for commit diff compatibility
const out = JSON.stringify(ordered, 0, 4);
// write output file
fs.writeFileSync(`src/locales/${f}`, out);
});