How to translate a Magento 2 extension?

How to translate a Magento 2 extension?

Generally, an extension consists of specific elements (i.e. interface, settings display, added content) which can be translated to another language. When making a translation, as the first step, look through the module's elements in the Admin panel — some of them can be edited on a store view scope, making it possible to translate them directly from the Admin panel. For the remaining parts of the module (in most cases, interface, frontend display, etc.), the translation needs to be done in the files. 

To translate an extension via files, follow the steps below. 

Step 1. Connect to your server via SFTP, navigate to app/code/Amasty/ExtensionName or vendor/amasty/extension-name and download the en_US.csv file to your computer. 

Step 2. Rename the file to match the required language code (i.e. pt_BR.csv) and open it in a text editor you find convenient.

Step 3. In the file, all lines consist of two parts separated by a comma. The right part of the string should be replaced with the translated text, as follows: 



Step 4. Proceed with translating all the needed lines and save the file when finished. If the existing line you are looking for is not present in the file, it can be added and translated similarly to the rest: 



Step 5. To make the changes show, upload the file to the same path via SFTP and run the following CLI commands from the root Magento directory:

rm -rf pub/static/*
php bin/magento set:static-content:deploy
php bin/magento cache:flush

Some extensions have backend and storefront separated (i.e. GiftCard for backend and GiftCardAccount for storefront); please consider that when translating.  
      • Related Articles

      • How to apply a patch to avoid overwriting modified files when updating the module?

        Magento allows adding patches to Composer in order to prevent modifications from being overwritten while updating the extension. To apply the patch using Composer, follow the guidelines below. Please note that this instruction works only for patches ...
      • How to apply a custom patch on Magento Cloud?

        Please make sure to test all patches in a pre-production environment. For Adobe Commerce on cloud infrastructure, you can create new branches with the magento-cloud environment:branch <branch-name> CLI command. To apply a custom patch on a Cloud ...
      • How to apply a patch?

        A “patch” is a compact representation of the differences between files, intended for use with line-oriented text files. It describes how to turn one file into another, and is asymmetric: the patch from file1 to file2 is not the same as the patch for ...
      • What information should I provide when submitting an issue-related ticket?

        In our support center, we are struggling to provide a solution for your request as fast as possible. Though, it might get delayed through verifying details, finding out your support license, Magento and module version and etc. There are several steps ...
      • Triggers found by SWAT report

        In Magento 2, for all changes in existing entities to properly reflect in the environment, a reindex is required. Specific events that enforce the reindexing process after changes in database tables are called triggers. Amasty modules do not add ...