Created
November 21, 2017 14:57
-
-
Save ridem/4ba8e5284d6a83cb084e43843de6bb47 to your computer and use it in GitHub Desktop.
Export langify theme sections' translations
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
var obj = []; | |
var translations = $(".translation-form-container textarea") | |
$('[id="asset-translation-area"]').each(function(object) { | |
obj.push({ | |
key: $(this)[0].previousElementSibling.textContent, | |
original: $(this)[0].textContent, | |
translation: translations[object].value | |
}) | |
}); | |
var downloader = $("<a id='download-file' href='' download='langify-sections-translation.json'></a>") | |
$("body").append(downloader) | |
var data = window.URL.createObjectURL(new Blob([JSON.stringify(obj, null, 2)], {type: "application/json;charset=utf-8;"})); | |
$('#download-file').attr('href', data); | |
$('#download-file')[0].click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment