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 translate the extension to another language?

        To translate the extension's interface, please refer to the following article. The description of cookies and cookie groups can be translated in Customers → Cookie Settings → Cookies/Cookie Groups → Edit. On the edit page, you may choose a store view ...
      • How to translate the privacy policy text?

        The extension doesn’t allow for editing the existing privacy policy once it has been submitted in the Enabled/Disabled status. To translate the existing policy, proceed to Magento Admin Panel → Customers → Privacy policy, choose the required policy ...
      • Can I translate the questions for different store views?

        The extension does not allow translation of the FAQ questions. However, it is possible to set the store views they will be used for: This way, you will be able to create separate questions for specific store views in different languages. Interface ...
      • How to update an Amasty extension?

        Below you can find a step-by-step guide for updating your Amasty extensions to latest versions. Before updating the module, it's recommended to create a backup of the modified extension files (if any). When the update is finished, you can re-apply ...
      • Does AMP support multiple stores? Will the module work with all our languages or we will need to translate something?

        The extension processes the pages of your website and excludes the content that is not valid for AMP. After validation, this page link is sent to Google. The AMP page will be rendered in the same language as the original page.