Skip to content

Child theme does not inherit translations from parent theme #17833

Closed
@rossmc

Description

@rossmc

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>

Metadata

Metadata

Labels

Component: TranslationEvent: khcd2018Event: mageconfFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions