Created
February 7, 2022 13:42
-
-
Save vaclavsvejcar/73b88d38f1c25b0841a28b7c4f04a0b4 to your computer and use it in GitHub Desktop.
SME properties generator
This file contains hidden or 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
(function () { | |
const json = JSON.parse(document.body.getElementsByTagName('pre')[0].innerText); | |
const lines = []; | |
for (let ns of Object.keys(json.cs)) { | |
for (let [key, value] of Object.entries(json.cs[ns])) { | |
lines.push(`${ns}.${key}=${value}`); | |
} | |
} | |
const text = lines.join('\n'); | |
const file = new Blob([text], { type: 'text/x-java-properties' }); | |
const a = document.createElement('a'); | |
a.href = URL.createObjectURL(file); | |
a.download = 'sme.properties'; | |
a.click(); | |
URL.revokeObjectURL(a.href); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment