Skip to content

Instantly share code, notes, and snippets.

@leobossmann
Last active November 7, 2017 18:26
Show Gist options
  • Save leobossmann/6042445 to your computer and use it in GitHub Desktop.
Save leobossmann/6042445 to your computer and use it in GitHub Desktop.
Shamelessly copy a checkout translation in the Shopify backend.
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;
});
$('.ssb').each(function(i, item){
$(item).find('input').val(transformed_lang[$(item).find('label').text()]);
});
});
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.
@stan-voo
Copy link

Hi! Is it possible that script doesn't work because I try to get non english translation?

@ridem
Copy link

ridem commented Nov 7, 2017

It's now outdated, check this gist for an up-to-date solution with examples: https://gist.github.com/ridem/7555c197d3495b79b30c3c062f4cb9bc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment