Translating custom discount title with Translate & Adapt

Translating custom discount title with Translate & Adapt

vc5411
Visitor
1 0 0

Hi,

 

I have been looking for the solution here on how to translate a custom discount title with Shopify's own app "Translate & Adapt", but cannot locate this after looking through many pages.

 

Does anyone know where I can translate this?

 

 

discount title.png

 

Thank you!

 

Cheers,

vc5411

Reply 1 (1)

DaisyVo
Shopify Partner
4469 501 598

Hi @vc5411 

I understand you're trying to translate a custom discount title using Shopify's "Translate & Adapt" app but haven't found a clear solution yet. Let's dive into this together.

The Issue:

Shopify's "Translate & Adapt" app is designed to help store owners translate various elements of their store. However, certain custom elements, like discount titles, might not be directly accessible for translation within the app's interface.

Solution:

To translate custom discount titles, you'll need to utilize Shopify's translation keys in your theme's Liquid files. Here's a straightforward way to do this:

1-Access Your Theme Files:

  • From your Shopify admin, go to Online Store > Themes.
  • Click on Actions next to your active theme and select Edit code.

2-Locate the Relevant Liquid File:

  • Depending on where your discount title is displayed, find the appropriate Liquid file. This could be within sections like product-template.liquid or cart.liquid.

3-Implement Translation Keys:

Replace your hardcoded discount title with a translation key. For example:

{{ 'discount.title' | t }}

  •  
  • In this example, 'discount.title' is the key you'll reference in your translation files.

4-Add Translations:

  • Navigate to the Locales folder in your theme.
  • Open the JSON file corresponding to the language you want to translate (e.g., en.default.json for English).

Add your translation key and the corresponding translated text. For example:

{

  "discount": {

    "title": "Your Discount Title Here"

  }

}

 

  • Repeat this process for each language file, providing the appropriate translation for each.

Important Note:

If you're not comfortable editing theme code or if this process seems daunting, consider reaching out to a Shopify expert or developer. They can assist in implementing these changes without disrupting your store's functionality.

 

If you need any other assistance, feel free to reply and I will try my best to help.

Best regards,

Daisy

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

Avada SEO & Image Optimizer - The #1 SEO solution