Last active
November 7, 2017 18:26
-
-
Save leobossmann/6042445 to your computer and use it in GitHub Desktop.
Shamelessly copy a checkout translation in the Shopify backend.
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
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. |
The https://[yourshop].myshopify.com/admin/locale_translations.json?locale_id=[locale_id] url returns a 404. Can't find the new JSON location.
Hi! Is it possible that script doesn't work because I try to get non english translation?
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
Didn't work for me. Perhaps it's outdated?
Or is it because I'm trying to change a dutch language? (and not english - as on line 14)