0

One client asked to internationalize a magento 2.2.3 store adding other two languages (English and Spanish). The current website is on production since April with only the default language and store view (Italian). I'm studying how to internationalize a magento store since it is the first time, but I have some doubts. I found some articles on the web and it is clear that I need to create the store views, download the language packages and then translate the contents.

https://support.weltpixel.com/hc/en-us/articles/115006305808-How-to-create-a-Multi-Language-Store-in-Magento-Tutorial

https://inchoo.net/magento-2/magento-2-create-multilanguage-store/

https://inchoo.net/magento-2/magento-2-administration/create-multi-language-store-magento-2-part-2/

  1. How to handle the current store view ?
  2. It is necessary to add the it code to the italian view?
  3. If yes, How to handle the old urls (without the store code).
2
  • As far as I understand it will be the same web, but just with more languages, right?
    – Raül
    Commented Aug 20, 2018 at 11:29
  • yes, you understood well. Commented Aug 20, 2018 at 11:41

1 Answer 1

0

You need to create:

app/i18n/<yourCustomName>/es_ES
app/i18n/<yourCustomName>/en_EN

Once created add a registration.php, language.xml, and a es_ES.csv or en_EN.csv in each folder.

Inside each language.xml:

<?xml version="1.0"?>
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">
    <code>es_ES</code>
    <vendor><vendor></vendor>
    <package>es_es</package>
    <sort_order>10</sort_order>
    <use vendor="<vendor>" package="es_es" />
</language>

Once you have these done and the .csv have data inside (make sure you try and find them online).

Then you go and create storeviews:

enter image description here

You should have Default WebSite and Default Store and Default StoreView (Or the Italian ones). So when creating 2 new storeviews, they should be childs of the default Store.

Hopefully I will have answered the questions.

8
  • Ok if i understood well i have to create two language packages or install theme from a vendor (like mageplaza). Then i need to create two store views with the language code. My answer is: i have to create a language code for the urls also for the italian view( the default one): Example: spanish: website.com/es english: website.com/en italian : website.com or website.com/it? If the second case i the right how can i redirect the old to the new one? magento does it or i need to write them in .htacces? Commented Aug 20, 2018 at 13:19
  • Well, the way I explained it so you have the same web, but the user would have at the top left or top right a comboBox where they can choose with which language do they want to see the web. You need to add them to your code, but not to vendor. If you want to create different websites, it's a different story.
    – Raül
    Commented Aug 20, 2018 at 14:55
  • Sorry, i explained it in the wrong way. I wanted to say that i would download language packages from mageplaza for the views Commented Aug 20, 2018 at 14:56
  • i think that i do not have enogh point to chat Commented Aug 20, 2018 at 15:07
  • Oke, no problem. It was just so we would't be chatting here.
    – Raül
    Commented Aug 20, 2018 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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