Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PROPHESSOR's HumanusTranslator translation.json depacker
/*
* PROPHESSOR's HumanusTranslator translation.json depacker
*
* Copyright (c) PROPHESSOR 05.12.2018
* MIT License
*
*/
const fs = require('fs');
const EXPORT_DIR = 'depack';
const translation = require('./translation.json');
const out = {};
for(const trans of translation) {
if(!out[trans[0]]) out[trans[0]] = [];
out[trans[0]].push(trans);
}
for(const filename in out) {
fs.writeFileSync(`${EXPORT_DIR}/${filename}.json`, JSON.stringify(out[filename], null, 4));
console.log(`${EXPORT_DIR}/${filename}.json OK!`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.