Hi guys,
I have a script for a custom payment instructions (bank account transfer). These instructions are visible only if the payment is selected.
I’m now trying to figure out how to set the script to two languages as the store is in 2 languages?
There is the original code:
The code works well. But sadly it shows up on both language sites.
Any ideas how to do it?
Thanks!
Hi @MarekRipa ,
In Shopify Theme’s code editing, there is a “Locales” folder that allows formatting languages through variables, so you can access it to customize and then insert those variables into the liquid file.
As for your case, you only transmit text, so multiple languages are impossible unless your script can handle multiple languages.
Please let me know if you need any further help.
Hi,
thanks for your help but can you please be more detailed about the localize?
I’m using the script in the Additional Scripts option in Settings → Checkout.
Is there any option to solve this only with the little edit to my script? I saw some other threads that are using this code but when I tried to implement it to my code, It didn’t work.
{% if request.locale.iso_code contains 'en' %}
{% elsif request.locale.iso_code contains 'de' %}
{% elsif request.locale.iso_code contains 'fr' %}
{% endif %}
Thanks!
Hi @MarekRipa .,
For each line highlighted in red, it will be checked what language the website is currently using.
So for each script, the function is the same. But with the text, you will have to re-translate according to each country.
Based on your code, I only can explain to you like that. In case you want to have more detailed information, you can kindly share access to your site with me.
Yes, I was thinking the same but when I tried this code it didn’t work. Can you please check if the code is OK?
{% elsif request.locale.iso_code contains 'cs' %}
{% endif %}