Magento Expert Forum - Improve your Magento experience

Results 1 to 2 of 2

How to work with multi languages in Magento 2

  1. #1
    New member
    Join Date
    Aug 2018
    Thanked 0 Times in 0 Posts

    Lightbulb How to work with multi languages in Magento 2

    A bit of background
    Magento 2 is a relatively new version of a fairly "powerful" solution for the creation of online stores. What makes it so "powerful"? Of course, this is a bulk of ready-made functionality out of the box, even in its free version… yeah, there is its free version, and this free version is also open-source with a very active community. In general, its development there goes like a grand slam; releases are frequent, there are a lot of features, the code is written thoughtfully, and special thanks for the emphasis on extensibility. But, as I said before, this version is relatively new and there are a lot of shortcomings in it; one of them will be discussed further.

    How this works
    As can be seen from the title of this section, it will be about how everything works there. Not about everything, of course: I have not enough years to describe it. We consider only the part that deals with multilingualism in Magento 2. And so, if you have a Magento 2 site, and if you do not use the default interface language (of course, English), then, of course, you came across to add, say, Russian to your site. Sample algorithm:

    1. Download the desired language (via composer, in the archive form, etc.); I want to add also that there are a lot of free language packs on the Internet
    2. Execute the command for static content deployment ` php bin/Magento setup: static-content: deploy ru_RU
    3. Clean out the Magento cache
    4. Set up our language in the admin panel to the admin default, and also for the front page of your site, or as an additional language.

    Now we see how our site has been changed, now it is completely in Russian, well, almost completely, and this is just a problem. Why? Well, I think this is not a difficult question why not everything is translated: you have downloaded a free language package, which, most likely, was made by enthusiasts from around the world, but perhaps not under the main theme, perhaps long ago, and many phrases are no longer relevant, and possibly there are no many of them, or say, they stopped supporting this language pack. And, of course, who uses the basic Magento theme in their online stores? I think no one. And you definitely have a good hundred, or even 2 hundred new phrases, which brought your new topic and, of course, only in the English language. The second problem comes from the first one: "Okay, thanks to those guys for most of the translation, but I can basically translate the rest myself, but how to perform this?"
    Provisional algorithm:

    1. Connect via SSH to your remote server where Magenta is installed (the first inconvenience)
    2. Search the translation file "ru_RU.csv". Where? Well, if you downloaded it via composer, then the file is located in the folder “vendor”, and if you once placed it yourself, you’ll find it where you had placed it (second inconvenience)
    3. Open the translation file with a console editor, or download it to a working computer to edit with some "human interface" editor, for example, Excel (third inconvenience)
    4. Save the file back into the same place rewriting it (fourth inconvenience)
    5. Next, do the same steps as in the previous algorithm for the installation; just start from the second step, and do not take the last step.

    As you can see from the algorithm, there are enough inconvenient steps. The first inconvenience is that you will need a specially trained person with SSH access to this server for this task and you need to be sure that this person will not do anything unnecessary there. Skills in the basic use of Linux system are not enough for the second step; the person needs to know where to look for this file in Magento. It's like a special knowledge, that is, a Magento developer is necessary. And if you do have such people on the staff, don’t you find that squandering such an expensive resource as a Magento developer or system administrator is too cool for such a trivial task as a translation? The 3rd and 4th inconveniences are simply not convenient in themselves and require basic knowledge in working with the Linux system.Unfortunately, we, cannot get rid of the step with the static content deployment, it's an inherent part of the Magento architecture.

    How to fix it?
    I think it would be a good idea to have the ability to change and add translations via the Magento admin panel, and this action could be the liability of a content manager or any person who somehow knows how to handle computers and worked with Word / Excel at least. The solution I would represent one of the variants to solve the problem; you can read in detail how to work with it following the link, and I’ll show you the main idea of using screenshots and words.

    And so, the magic solution looks like this:

    The picture shows that we have in our system a list of languages which are here due to using of the orange button "Add New Language" (except for "en" which will be your default after installing the module).

    And this is how the dictionary editing template for the desired language directly looks:

    As you can see from the screenshot, the built-in, powerful and convenient tool "Grid" is used. It allows you to filter the dictionary list according to many attributes: module, part of the translation word, part of the source word, so It also has the ability to change the desired phrase directly with a single click on it.

    Simplified version without filtering:

    For any language, you will be able to generate a CSV file,
    which will be immediately placed in the right place, whereupon it will be used by the Magento command of the static content deployment. Alternatively, you can take this file and present or sell it to someone else, share it with the same person who gave you the basic version of this language pack, or simply use it in other projects. You can also just save it. Additional convenience is the ability to align with the base language (en_EN). For example, after the next update to the latest version of Magento, the code base has obtained a couple of new words, or a lot of new words if the update brought a new module with it. The guys, who provide free language packs for Magento will probably react to this and add them to their repositories, but not immediately, and you already have the opportunity conveniently enough to complete the necessary translations, generate a CSV file and possibly share it with those uninterested enthusiasts.

    Magento 2 still has a large field of activity for future improvements. Write new features and modify existing ones, automate routine processes and share them with others, even if not free of charge (your time spent should be surely rewarded). And the last - know the value of your time, and automate the processes which otherwise make you suffer from routine.

    View more threads in the same category:

    Last edited by dengroisman; 29-08-2018 at 05:35 PM.

  2. #2
    Junior Member
    Join Date
    Nov 2019
    Thanked 3 Times in 3 Posts


    Nice suggestion! Thanks for sharing.

    How about if you get a ready-made solution to enable multi-lingual support on your Magento 2 store? It sounds good, right.

    You can take the help of a module - Google Translate Integration Magento 2 Extension. It supports more than 90 different languages. So, you can easily target different language speaking groups and increase the reach of your business world-wide.

    Name:  Google-language-translate-integration-frontend-select-language-option.png
Views: 1
Size:  114.4 KB

    In many cases due to language problems, customers are unable to understand what you are offering to them. Although English is a global language, there are certain regions where people are not familiar with English. To target those groups of people your website must provide language translation support.

    Google Translate Integration is a perfect tool to help you make your store language friendly and increase your sales volume in no time.

    Let's check out the features of this extension here:
    • Allows translating the website into more than 90 languages to set up your scope among universal customers effectively.
    • Ability to add a custom code snippet to extend the extension's functionality for that store.
    • This Magento 2 language switcher extension has 3 different layout options – Simple, Horizontal, and Vertical.
    • Automatically translate your product details, categories, description, and CMS content using this Magento 2 language pack.
    • Attract more customers around the world without the language barrier and make the most out of it.

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts