Create a multi-language store in Magento 2 – Part 2

Create a multi-language store in Magento 2 Part 2

In the first post from this series, we’ve focused more on theory and technical background behind multi-language Magento2 store. Now, we’ll create Magento2 store with additional French language. First thing is to go to the administration and create a new store view. Before we proceed, please check documentation where is explained a difference between store view, store and website, old but still relevant, http://docs.magento.com/m1/ce/user_guide/store-operations/stores-multiple.html.

Inside Magento 2 admin go to Stores – Configuration – All store and please follow steps bellow and create new store view.

You need to populate some basic info about store.

After Save we will have 2 store views named English (Default store) and new one French store.

Next go to Stores – Configuration, and now please pay attention on store “scopes”, store view needs to match to language which you want to edit.

Now change to desired Country, French, Belgium maybe.

Next important thing is Locale, here you need to select which language store will speak, based on that we will install language pack.

So right now we will have store switch on frontend.

So, the next thing is to install the language pack. I will use the one downloaded from github. Now, there’s 2 most common installation approach. First one is to use a composer. That is recommended, because in feature it will have updated terms with newer version of Magento, but I prefer to download and install manually language pack for most obvious reason – one language pack will not cover all phrases and you will need to manually add some or change current one. So I will manually install French language pack :-).

After you have downloaded language pack, copy it inside Magento app directory, create a new folder i18n, Create Folder named upon vendor, and lastly create folder using store language codes, in our case it’s FR_fr.

So, the path will look like this:

magento_install_dir/app/i18n/vendor_name/fr_FR/...

After we have copied files next step is to flush Magento cache.

Now on frontend switch to French language store and there will be translated common terms like welcome, log in, register, search newsletter etc. Please note this is Magento with sample data, you need to translate static blocks in order to have all content translated to french language. Also there is an option to create a different homepage and add different content for each store view.

 

I hope that this short “walktrough” is enough for starting to expand business and engage customers on different languages with Magento2.

Related Inchoo Services

You made it all the way down here so you must have enjoyed this post! You may also like:

Create a multi-language store in Magento 2 – Part 1 Stanislav Mihic
Stanislav Mihic, | 0

Create a multi-language store in Magento 2 – Part 1

Adding a new language in Magento Zeljko Prsa
Zeljko Prsa, | 27

Adding a new language in Magento

5 comments

  1. Great article.
    Previously I’ve also created store views for different languages, but I’ve found that it takes longer for switching from developer mode back to production the more languages I add. Magento seems to have compiled the different languages for the backend and the Luma theme too which I don’t use at all. Is it possible to exclude these somehow when changing between the modes?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.

Tell us about your project

Drop us a line. We'd love to know more about your project.