0

I'm trying to customize a theme with a child theme. When I add a new class in the css with background image it works like a charm in development both EN and FR (my 2 languages). I use the setup:static-content:deploy command in my production site to apply changes :

  • EN : ok
  • FR : images don't show in frontend

After many try, I check the /pub/static files : images are copied only in the EN folder (/pub/static/frontend/Vendor/theme/en_US/images). If I put directly the image in the fr_FR folder it works.

I'm probably missing something in my .phtml file to declare this in all languages available. Thanks for your help

2
  • Which Magento 2 version do you run? Commented Jan 6, 2018 at 14:00
  • Another question, what errors do you get in Chrome developer tools? 404s on the specific images - if so, the second reply in the answer below could be applicable. Commented Jan 6, 2018 at 14:21

2 Answers 2

1

I've faced two bugs that may be related. This is not really related to your hypothesis about missing something in the .phtml-file.

Static files are not generated for empty child themes. There must be one file in the web-folder. Workaround in short, put one file in the theme/web/images-directory and rerun setup:static-content:deploy.

Read more about it here, or at GitHub.

Bugs in static content deploy. This bug impacted CSS and language for translated sites for me. I deployed my second language first, and then a global language deploy, on the specified theme. Not in the same command.

Example:

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 

Read more about it here at GitHub.

1
  • very interesting reading. that's probably why some of the terms in my child theme where not translated...
    – cap340
    Commented Jan 7, 2018 at 0:03
2

Try :

php -f bin/magento setup:static-content:deploy fr_FR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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