How to Translate Magic Tooltips for Gravity Forms to Other Languages

Just like many other WordPress plugins, Magic Tooltips for Gravity Forms plugin only includes the English language. What should you do if you are using other languages on your site? You will need to translate the plugins to the language that you are using. Translation is a common thing in WordPress. Thanks to the open source nature, you can customize almost anything. Thus, translating a plugin including Magic Tooltips for Gravity Forms to another language is possible.

In this article, we are going to show you different ways of translating WordPress plugins. This will be mostly a technical post, so you will need to follow the steps just like a tutorial.

Pre-Step: Find the POT file in the plugin

Before starting the translation process, you have to make sure that the plugin (Magic Tooltips for Gravity Forms) is ready to translate. This means that strings within the plugin’s code have been localized using the GNU gettext framework.

Reference: https://codex.wordpress.org/I18n_for_WordPress_Developers

You can ensure whether a plugin is ready to translate or not by finding out the POT (the .pot file is needed to translate plugin strings to another language) file inside the /magic-tooltips-for-gravity-forms/languages/ directory of a plugin source files. Please have a look at the following screenshot of Magic Tooltips for Gravity Forms’ POT file.

You have to use this file later for existing strings to other languages. You can choose one of the following methods for translating.

Translate Using POEdit 

Prerequisites: Before you start translating, you must have the following:

  1. .POT file – you generated it before
  2. A free version of POEdit software.

Translation Process

You need to use POEdit to open the .POT file to create the .po (Portable Object) file and transform it into the .mo(Machine Object) files.

Here, .POT is the file created when you translate your POT file to a particular language. For example, fr_FR.po.

.MO is the file that the machine can read, it’s a binary file. You’ll have to convert your .po file to .mo file. For example, fr_FR.mo.

Steps

  1. Open POEdit → File → New
  2. Choose the language you need to translate the plugin into.
  3. Click on “Update from POT”.
  4. Save the file as it suggests to you (the language code; for example fr_FR.po, es_ES.po). Find your language code here.
  5. Open the POT file that you created before.
  6. Start translating strings using POEdit.
  7. Once you are done with the translation, click File -> Save.
  8. Create the .mo file by going to File -> Compile to MO.
  9. Move both .po file and .mo files to languages folder in the plugin (e.g: /magic-tooltips-for-gravity-forms/languages/) directory. You can keep these files in the following directory as well (/wp-content/languages/plugins/).

Now you can see the translated strings on your site.

Translate Using Loco Translate plugin: Loco Translate allows you to create language files via WordPress admin.

Prerequisites: Before you start translating, you must have the following:

  1. .POT file in /magic-tooltips-for-gravity-forms/languages/ directory.
  2. Install and activate the Loco Translate plugin. Here is the installation process: https://wordpress.org/plugins/loco-translate/#installation

Translation Process:

  1. Navigate to wp-admin → Loco Translate → Plugins
  2. You can see available plugins on this page, click on Magic Tooltips For Gravity Forms that you want to translate.

Click on Advanced tab and configure the following options.
→ Text Domain
→ Template File (Relative path from bundle root to the POT file you generated)

Click on + New Language button.

Choose a language & click on Start Translating button.

Now select strings, translate and save the translation.

All done, now you have the Magic Tooltips For Gravity Forms plugin strings translated to another language.