Skip to content

Instantly share code, notes, and snippets.

@PROPHESSOR
Created December 8, 2018 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PROPHESSOR/b0154ebbe17c242088080b43a511a77c to your computer and use it in GitHub Desktop.
Save PROPHESSOR/b0154ebbe17c242088080b43a511a77c to your computer and use it in GitHub Desktop.
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