Dear, I am using Magento 2.2.x and need to make different languages to load like Folders - /en /de /fr
How can I achieve this, please help me?
Solved! Go to Solution.
Yes , you can easily do it with magento 2's native functionality.
Magento 2 have multi-store and multi-website functionality where we can create another store for another language.
lets take example - you need to create a new store in french language so create a new store from magento 2 backend from store->all stores menu. then give store code as fr.
Now go to the store->configuration->general->web-> Add Store Code to Urls as Yes !!
so on the frontend - when you see the language switcher and when click on French language store - in the URL it will shows yourdomain.com/fr
Below i am sharing reference links as well - how to create a store and make multi-language for the same.
Hope it helps to you !!
@ManthanDave Thank you, this is what I want. I have one additional question, can you tell me, if is it possible to make this:
For example I have 10 languages, but I want my default to be English. Now for every language I have /en /fr /de and etc. code, but is it possible to make for English version, which is my default store to be without code? So, English to use the default URL www.website.com and not /en in additional to the tail of the address?
Using the "Add store code to URL" you can't.
That configuration is global.
That means you can't use different configuration values per website or store view level.
Can you share the configuration you've mentioned?
rationalize - i think i missed out something or understand something else - you are correct !! i have updated my answer !!
There is a workaround using directories but you should need to set some directories/files and some configuration on your server.
I didn't tried this approach using M2 yet, and there isn't an official document to implement the approach but maybe you can explore this link: https://gist.github.com/thagxt/0f605f0a8a95c79302db0d2f04383788
That isn't a recomendation but a link to explore and learn how to get that kind of configuration.