0

We have a site that has been designed with a new theme for each language and each language on a different URL.

It's not how I would have built it but we have to "run what you brung".

The problem I have is deploying static content takes hours as it does every language (12) for each theme (18? Some themes are for dual language countries like China in Chinese and English) plus the base themes like Luma and Blank.

I know once the initial compile is done I can target re-deployments with -theme and -l but I am wondering if I can do a full compile but specify "only compile this theme in this language and this theme in this language"

Edit for clarity To be 100% clear, I am well versed in the Magento CLI and how to select different languages and restrict to different theme's and areas, how to exclude themes etc.

I am looking specifically to see if there's a way to issue a deploy command that deploys each theme but only in the languages they are designed for, not all the languages declared as available.

As per above, 12 langs and 18 themes causes 216 deployments (plus base themes!) and takes a long time. In fact, the language to theme map means we only need to compile about 20-30 of these combinations as the other languages are useless in the context of all but the specific theme designed for them...

I am also well aware that this site is not correctly structured and that is the root cause for this SNAFU, that a base theme should be used with internationalization to provide translation and sub-themes for lang specific layouts and blocks, but I'm not working on my own creation but rather deploying changes to an existing production environment, so I can't really rebuild it all from scratch (much as I'd like to!)

PS> Thanks for the grammar check @Evince, typing too quick again!

-1

You can use

For different language

php bin/magento setup:static-content:deploy en_US

For different theme (Working on 2.1.1 or later)

php bin/magento setup:static-content:deploy --theme="Magento/backend"
  • Thanks however as per question I'm looking to combine different languages and themes at the same time, without every listed language for every listed theme... – cygnus digital Oct 10 '18 at 11:56
-1

Yes you can do it using below command.

php bin/magento setup:static-content:deploy --theme Vendor/theme1 --theme Vendor/theme2

Exclude themes By this command:

php bin/magento setup:static-content:deploy --exclude-theme Vendor/yourtheme

For specific theme and specific language:

php bin/magento setup:static-content:deploy --theme Magento/backend --theme Vendor/theme1 en_US ko_KR
  • Thanks however as per my question I know how to deploy a specific theme for a specific languages, I'm looking for a way (might not be possible) to compile specific themes for specific languages. For instance Theme-en for en_US and en_GB and Theme-Swiss for de_CH and fr_CH without chaining like 12 different compile commands. Almost like declaring what languages the theme is for in the theme config. At the moment 12 languages and 18 themes causes deploy to process 216 theme & lang combinations and takes hours even though most languages in the list are not used in each theme – cygnus digital Oct 10 '18 at 11:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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