Created
March 3, 2020 09:46
-
-
Save hilnius/91a78c5e1e0d51567c3ddbae37748b17 to your computer and use it in GitHub Desktop.
Import many translations in Lokalize
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
var translations = { | |
"es_title": "Personnalisation des emails", | |
"es_senderName": "Nom d'expéditeur", | |
"es_subjectPrefix": "Préfixe de l'objet", | |
"es_separatorColor": "Couleur du séparateur (format #hex)", | |
"es_logo": "Logo (format png, 10ko max)", | |
"es_defaultLogo": "Aucun fichier n'est présent, le logo Supermood par défaut sera utilisé", | |
"es_emailPreview": "Contenu des emails", | |
"es_emailPreviewInfo": "Vous pouvez personnaliser le contenu de vos emails ou obtenir un aperçu depuis les pages “Règlages” du SuperScore et du SuperFeedback.", | |
"es_save": "Enregistrer" | |
}; | |
function importIndex(index) { | |
if ($('#btn_addkey').hasClass('disabled')) { | |
setTimeout(function () { | |
importIndex(index); | |
}, 50); | |
} | |
var keys = Object.keys(translations); | |
if (index >= keys.length) { | |
return; | |
} | |
var key = keys[index]; | |
console.log('importing', key, 'as', translations[key]); | |
$('#keyName').val(key); | |
$('#base-value').val(translations[key]); | |
$('#btn_addkey').click(); | |
importIndex(index+1); | |
} | |
importIndex(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment