cancel
Showing results for 
Search instead for 
Did you mean: 

Static content referenced in wrong language

Static content referenced in wrong language

Hello,

 

I have managed to install magento2.0.2 on a windows 10 machine, running apache 2.4.

 

After fiddling around with rewrite rules and running the content deploy using the command line setup command I have got the luma site up and running.

 

However, various static items are not displayed.  This is particularly obvious on the admin screens.

 

I installed with the en_GB language and did the static content deploy with en_GB option too.

 

Using the page inspector I can see that some of the static content is trying to reference the en_US file paths rather than the en_GB ones I deployed.

 

<img class="logo-img" src="http://mysite.demo.com/Magento2/pub/static/adminhtml/Magento/backend/en_US/images/magento-icon.svg" alt="Magento Admin Panel">

 

In this example, the image exists but in the en_GB folder not the en_US.

 

Is there something I can do to rectify this please?

Tags (1)
3 REPLIES

Re: Static content referenced in wrong language

You can specify a language explicitly with the "setup:static-content:deploy" command: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-static-view.html#conf...

Re: Static content referenced in wrong language

Hi Dmitry,

 

Thanks for your reply, however, I have already done this.  I specified the language I wanted both when I ran the install of magento and when I did the static content deploy, both using the same en_GB setting.

 

The output from the deploy indicated it had deployed the correct language and indeed the files and folder structure reflect this.

 

Unfortunately, when the pages are generated they contain references to files in the en_US folders, which don't exist.

 

I suspect these are being generated dynamically based on a setting somewhere - anyone have any idea?

 

Thanks,

 

Russ

Re: Static content referenced in wrong language

Sorry this is a bit late for you but it might help someone else...

 

I did the same as you, selected English (United Kingdom) on install and it was set like that in the local settings when I checked, yet it still produced en_US pages.  I had to set it to English (United States) in the local settings then back to English (United Kingdom).  After that it produced en_GB references for javascript and css as expected.

 

Just an note that the theme I am using has en_US hard coded into it.  I used grep to search out en_US in the theme before installing it and replaced it with en_GB.

 

Local settings are at:-

 

Admin pages - Stores - Configuration - General - General - Local Options. I set to English (United States) then back to English (United Kingdom)

 

I then deployed static content using the en_GB flag.

 

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

 

Hope this helps someone.