Additional Script in Checkout page translate?

Topic summary

Goal: Show custom bank transfer instructions at checkout only for the selected payment method, with language-specific text for a two-language store.

Current implementation: A script on the order status page checks if the gateway is “Bank Deposit” and injects instructions via Shopify.Checkout.OrderStatus.addContentBox. It currently displays the same text on all languages.

Proposed approaches:

  • Use Theme “Locales” (translation files) and insert localized variables into the Liquid/script.
  • Use Liquid conditionals based on request.locale.iso_code (e.g., ‘en’, ‘de’, ‘fr’, ‘cs’) to output language-specific text blocks.

Issue: The merchant is adding code in Settings → Checkout → Additional Scripts and reports that the request.locale-based conditions did not work (including a test for ‘cs’). No working example or error details were provided.

Status: Unresolved. The helper notes language must be manually provided per locale and offers to review store access for specifics.

Open questions: Whether locale variables and request.locale are available/evaluated in the Additional Scripts context and the correct Liquid syntax/structure needed there.

Note: Attached screenshots illustrate locations/settings but are not critical to the solution.

Summarized with AI on February 5. AI used: gpt-5.

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 %}