How to install a language pack for Magento 2?
3 days ago
The Most Popular Extension Builder for Magento 2
With a big catalog of 224+ extensions for your online store
Language is one of the essential elements of all online stores because it is the best way to convey your message and help customers understand your store and products. If you want to introduce your items to the global audience, more than one language should be implemented on your site. As Magento stores support multiple language installations, it is not easy to set up a language pack on your website.
Therefore, in this post, we will guide you with a simple method for Magento 2 language pack installation. We hope that our instruction will help you get rid of all the difficulties along the way.
Table of contents
- Overview of Magento 2 language pack and translation
- How to install Magento 2 language pack for your store?
Overview of Magento 2 language pack and translation
The core function of Magento 2 language translation
Magento 2 language translation allows you to make your store become localized for multiple regions and international markets. By easy-to-update translation dictionaries and nonduplicated code, you can be able to improve the localization and customization of Magento instances.
It is quite simple to change the position of a language pack and save it in any directory of your extension. The phrases for translation are enabled in the phrase class.
Outstanding benefits of a language pack
The Magento application automatically identifies the packages between the module and theme ones included in the direction. An entire dictionary in one directory can be utilized and distributed as a standalone component similar to modules and themes.
You can use the ready-to-use language packages generated by other users, or you can create your own language pack.
You can create localizations based on existing, or parent, translations using language inheritance, which means if you missed or omitted localizing on some phrases or terms, parent translations are used.
You can customize your translations even further by creating more than one version of a translation for the same language.
Based on your purpose, you can use the existing language packages or translate Magento by yourself.
How to install Magento 2 language pack for your store?
Step 1 Download Magento 2 language pack
Right on our site, Mageplaza is now providing a variety of free language packs for Magento 2. From the world’s largest collection, you can find any language pack with detailed instructions for easy installation. Also, your contribution to text translation is highly welcomed.
GET YOUR MAGENTO 2 LANGUAGE PACKS
Step 2 Install a language pack
You can follow the standard instructions from Mageplaza to install the language pack via the composer. Now, we use the Arabic Language Pack as an example.
Method 1: Install via Composer
Install Arabic pack
It is simple to install a language pack via the composer
composer require mageplaza/magento-2-arabic-language-pack:dev-master
php bin/magento setup:static-content:deploy ar_SA
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush
At this stage, this message will be shown up
Please navigate to Access Keys page and Create A New Access Key.
Also, you can use these keys
Public Key: c7af1bfc9352e9c986637eec85ed53af
Private Key: 17e1b72ea5f0b23e9dbfb1f68dc12b53
Update Arabic pack
Please run the following code line to update the Arabic pack
composer update mageplaza/magento-2-arabic-language-pack:dev-master
php bin/magento setup:static-content:deploy ar_SA
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush
Method 2: Install via command line
For the first start, please download the language file to your installation root directory and then run the command below
wget https://github.com/mageplaza/magento-2-arabic-language-pack/raw/master/ar_SA.csv
php bin/magento i18n:pack -m replace ar_SA.csv ar_SA
php bin/magento setup:static-content:deploy ar_SA
php bin/magento cache:flush
A directory language pack, which includes the proper structure of language files for your installation will be generated. You should copy it over to your Magento installation and the translation should be visible.
It is important that you do not find an additional directory i18n in your installation. Do not worry, you can skip this file.
Special note After your language pack is installed successfully, the activation action must be followed. From the Magento 2 admin panel, navigate to Stores > Configuration > General > Locale Options.
Choose Arabic (Saudi Arabia) and click Save Configuration
Conclusion
We have completed our guide on how to install a language pack for Magento 2. Together with various language packs, we hope that you can take advantage of this instruction and add more languages to your store sites to make them more friendly to global customers.