Created
December 8, 2018 15:10
-
-
Save PROPHESSOR/b0154ebbe17c242088080b43a511a77c to your computer and use it in GitHub Desktop.
PROPHESSOR's HumanusTranslator translation.json depacker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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