Setting the default language in Shopware 6

Once the Shopware DB is set-up one cannot change the default language anymore. During installation you are not even asked what default language you want to use. So where does one set the default language properly?

Problem

If you’re installing Shopware from the Production Template (like I did), and follow the installation instructions closely, you will end up with a store that uses English as the default language. While this might be perfectly fine if you have all of your content in English language, it will be most likely a problem if your Ecommerce business requires a different langauge.

Neither during the creation of the environment file nor during the database creation Shopware 6 asks you, which default language you want to use. And unfortunately, Shopware 6 does not allow you to change that language in the backend at a later time. Given the fact that Shopware is being mostly used in German-speaking countries as well in the rest of Europe, you probably want to change that behaviour from the start.

So to fix that and in order to have Shopware 6 take your preferences into account, you have two options:

Solution 1:

After the creation of the .env file with bin/console system:setup do not continue with the bin/console system:install command which creates the DB, but open your websites’ URL in the browser instead. You will be redirected to yourwebsite.com/recovery/install and Shopware presents you with the web installer. Here you can actually choose the default language.

Solution 2:

After the creation of the .env file with bin/console system:setup do not continue with the bin/console system:install command which creates the DB, but run the following command in your shell

php vendor/shopware/recovery/Install/index.php

This CLI command will start an interactive shell prompting you for various site settings including the default language. The expected input isn’t quite clear always and not a 100 percent intuitive. For example when choosing the default country the default value is GBR (Great Britain), which actually hints you to the excepted 3 digit ISO code. So in order to switch to Germany you need to enter DEU.

tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo tech logo