Skip to content

Major 2.1.3 regression bug breaks js translations, caused by overly aggressive performance optimizations of the static content deployment #7862

Closed
@hostep

Description

@hostep

Preconditions

  1. Magento CE 2.1.3
  2. PHP 7.0.14

Steps to reproduce

  1. Install Magento CE 2.1.3 using composer
  2. Install a couple of language packs (for example one for nl_NL and fr_FR)
  3. Setup multiple storeviews, each one in a different language
  4. Put your store in production mode (I used the --skip-compilation flag)
  5. Run setup:static-content:deploy --theme=Magento/luma en_US nl_NL fr_FR
  6. Go to each storeview in the frontend and go to the 'create an account' page
  7. Don't fill in the fields, just press the 'Create an Account' button

Expected result

  1. The warnings about the required fields are translated on each different storeview in its own language

Actual result

  1. The warnings about the required fields on all different storeviews are all in English (the first language of the setup:static-content:deploy command)

Discussion

Magento 2.1.3 has optimized the static content deployment so it only generates the content for the first language and then blindly copies that directory to the other requested locales.
This is really great, because 99% of the files in those directories are always the same.
Except for the javascript translations...
And now we have this problem caused by this optimization.

More info

In Magento 2.1.2, if I take a diff of the nl_NL & fr_FR directories, I see 4 files which differ:

....pub/static/frontend/Vendor/theme $ diff -rwq nl_NL fr_FR
Files nl_NL/css/email-inline.css and fr_FR/css/email-inline.css differ
Files nl_NL/css/email.css and fr_FR/css/email.css differ
Files nl_NL/css/styles-m.css and fr_FR/css/styles-m.css differ
Files nl_NL/js-translation.json and fr_FR/js-translation.json differ

I'm not sure if the changes in the email css files are important, the changes in the styles-m.css files only differ by the order in which they are defined (which is weird, but whatever), but the most important file is that js-translation.json file.

Workaround

You can work around this bug by executing the setup:static-content:deploy command for every language separately:

php bin/magento setup:static-content:deploy --theme=Magento/luma en_US
php bin/magento setup:static-content:deploy --theme=Magento/luma nl_NL
php bin/magento setup:static-content:deploy --theme=Magento/luma fr_FR

But this means you can't depend on the performance optimization which runs these processes in parallel, which was introduced in 2.1.1.

@ Magento team: seriously, can you actually test stuff before releasing them into a new version? We aren't waiting on new "performance optimization" features, we just want bug fixes for now, not new features with new bugs.

@woosley-mg @benmarks: I expect this major bug the be resolved in maximum 2 weeks (or let's make it 3 due to the upcoming holidays). Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: SetupComponent: TranslationIssue: 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 passedReproduced 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