Magento2: Child theme does not inherit translations from parent theme

Created on 28 Aug 2018  ยท  10Comments  ยท  Source: magento/magento2

Summary of the issue
Theme inheritance does not work as expected with translation dictionaries. The child theme does not use any translations defined in it's parent theme's en_US.csv translation dictionary.

Preconditions
I'm working on a Magento ver 2.2.5 installation with two websites & two corresponding theme's. Each with their own translation dictionary, and one theme inheriting from the other.

Steps to reproduce

  1. Set up a magento instance with two websites and with two theme's, one inheriting from luma and the other inheriting from the other theme you created. See theme structure below.
  2. Add a the translation string "Create New Customer Account","Create New Account" to the parent theme's en_US.csv translation dictionary.
  3. Go to the _/customer/account/create/_ URL for the website with the child theme applied.

Expected result
The page title should be _Create New Account_

Actual result
The page title is still _Create New Customer Account_

  • If go to the _/customer/account/create/_ URL for the website with the parent theme applied, the page title should is _Create New Account_. So the child theme is not picking up translations from the parent theme.
  • If you add the translation string "Create New Customer Account","Create New Account" to the Child theme's en_US.csv translation dictionary you can see the translation string applied corectly on the website with the child theme applied.

Is this a bug with Magento or am I doing something wrong?

Is the translation dictionary documentation incorrect and this is actually the correct behaviour?


Theme Structure

app/design/frontend/Ross
โ”‚
โ”œโ”€โ”€ parent
โ”‚ย ย  โ”œโ”€โ”€ composer.json
โ”‚ย ย  โ”œโ”€โ”€ i18n
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ en_US.csv
โ”‚ย ย  โ”œโ”€โ”€ registration.php
โ”‚   โ””โ”€โ”€ theme.xml
โ”‚   
โ””โ”€โ”€  child
 ย ย  โ”œโ”€โ”€ composer.json
 ย ย  โ”œโ”€โ”€ i18n
 ย ย  โ”‚ย ย  โ””โ”€โ”€ en_US.csv
 ย ย  โ”œโ”€โ”€ registration.php
    โ””โ”€โ”€ theme.xml

Parent's theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Ross Parent</title>
    <parent>Magento/luma</parent>
</theme>

Child's theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Ross Child</title>
    <parent>Ross/parent</parent>
</theme>
Translation khcd2018 mageconf Fixed in 2.2.x Fixed in 2.3.x Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.2.x Reproduced on 2.3.x

All 10 comments

Hi @rossmc. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [x] Summary of the issue
  • [x] Information on your environment
  • [x] Steps to reproduce
  • [x] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@rossmc do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [x] yes
  • [ ] no

@rossmc, thank you for your report.
We've acknowledged the issue and added to our backlog.

khcd2018

@SavchenkoVladimir thank you for joining. Please accept team invitation here and self-assign the issue.

Hi @vpodorozh. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

mageconf

This commit cf313ba was made with incorrect author git config - that is why Anton Evers was added as an author. I've removed this branch and will re-create my commit with correct author config.

Hi @rossmc. Thank you for your report.
The issue has been fixed in magento/magento2#19018 by @vpodorozh in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

Hi @rossmc. Thank you for your report.
The issue has been fixed in magento/magento2#19144 by @vpodorozh in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

Hi @rossmc. Thank you for your report.
The issue has been fixed in magento/magento2#19023 by @vpodorozh in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.8 release.

Was this page helpful?
0 / 5 - 0 ratings