Description
Preconditions
- Magento CE 2.1.3
- PHP 7.0.14
Steps to reproduce
- Install Magento CE 2.1.3 using composer
- Install a couple of language packs (for example one for nl_NL and fr_FR)
- Setup multiple storeviews, each one in a different language
- Put your store in production mode (I used the
--skip-compilation
flag) - Run
setup:static-content:deploy --theme=Magento/luma en_US nl_NL fr_FR
- Go to each storeview in the frontend and go to the 'create an account' page
- Don't fill in the fields, just press the 'Create an Account' button
Expected result
- The warnings about the required fields are translated on each different storeview in its own language
Actual result
- 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!