0

I understand the general structure of i18n csv files that is like

<key_hook>,<translation_of_that_key>

but according to the documentation there is the possibility to add a module restriction:

<key_hook>,<translation_of_that_key>, module, <module_vendor>

In my case in de_DE.csv (in my custom theme i18n directory) I've used:

"Summary", "Zusammenfassung", module, Magento_Review
"Summary", "Kassenübersicht", module, Magento_Checkout

The problem is now that if the customer likes to write a review on the single product page, there is still "Kassenübersicht" instead of "Zusammenfassung". Why is that? Does this restriction really work? Do I (really) have to use different original Translation Hooks?

Magento Verion 2.3.5

1

Magento's translations are a pain and the documentation for them is even worse.

Theme translations are global and will affect the string regardless of the module, to translate on a per module basis you need to use a translation package. I'm not sure if this is intentional behaviour or if it's a bug that module based translations don't work in the theme.

The main differences between theme translation and translation packages are:

  • They support module based translations
  • Theme translations are placed in {theme}/i18n/ whilst translation package are placed in app/i18n/
  • Translation packages require registration.php and language.xml files

You can find instructions for how to create a translation package here. Note that it's optional to gather all the available strings.

2
  • Thanks for the input. I guess we will overwrite the original Language definition with something like Summary_Review and Summary_Checkout. Time is money. – Pete Jan 11 at 10:27
  • 1
    Yeah, I sometimes just change the strings in the template where feasible. I don't like doing it but it's often better than faffing around with broken translations for hours just to change a word. – Ben Crook Jan 11 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.