Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save theamnesic/b2d3e7288b43d9680f97 to your computer and use it in GitHub Desktop.
Save theamnesic/b2d3e7288b43d9680f97 to your computer and use it in GitHub Desktop.
When logged in, go to "Settings > Checkout > Checkout Language", click the "View and customize this translation" link.
A page with a url like this opens: "https://yourshop.myshopify.com/admin/settings/locales/[locale_id]".
copy [locale_id].
Go Back and choose "create a new one".
Open the Javascript console, paste this (change to your shop/locale_id first):
$.get('https://[yourshop].myshopify.com/admin/locale_translations.json?locale_id=[locale_id]', function(data) {
transformed_lang = {};
$.each(data.locale_translations, function(i, item){
transformed_lang[item.english] = item.text;
});
$('li.divider').each(function(i, item){
translatedText = transformed_lang[$(item).find('label').text()];
if(translatedText != null) {
var e = $.Event("keydown", { keyCode: 32});
var ee = $.Event("keyup", { keyCode: 32});
var e2 = $.Event("keydown", { keyCode: 8});
$(item).find('input').val(translatedText).focus().trigger(e).trigger(ee).trigger(e2);
}
});
});
Voilà, it's yours to edit. You have to tab through every single one of the fields in order to effectiviely "get" the strings, but that's small work compared to translating all by yourself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment