Facebook Pixel

How to Translate WordPress Theme – Full Theme Translation Guide

How to Translate WordPress Theme – Full Theme Translation Guide

Are you looking for a WordPress theme translation plugin? Loco Translate is definitely the best right now. Indeed, it is a plugin that offers the translation of WordPress themes and plugins. If you have translated your website and notice that part of the website is not translated, you must surely validate if the texts are not in the codes. During the development process of WordPress websites, sometimes the developer finds it necessary to put some of the content in the code. And, this is done with specific functions like __() and _e().

In this article, we will see together how to use loco translate for WordPress theme and plugin translation.

What are the conditions for using the WordPress theme translation plugin?

You can only use the WordPress theme translation plugin if your template uses the text domain. Indeed, WordPress uses the concept of text domain (or text domain in English) with functions such as _e or __ to manage content in codes. Therefore, during the development process, developers must be sure to use these functions to facilitate translation. For exemple; If I want to include the text “Click to learn more” in the code, we could have:

 <?php _e("Click to learn more", "prositeweb"); ?>

Or

 <?php echo __("Click to learn more", "prositeweb"); ?>

If, however, in the codes we have:

<?php echo "Click to learn more"; ?>

Loco translate will not be able to consider. Even less any other alternatives to Loco translate.

Install and configure Loco Translate

  1. Installing the plugin
    • Go to the “Plugins” section of your WordPress dashboard, click “Add” and search for “Loco Translate”.
    • Install and activate the plugin to add new translation features to your site.
  2. Initial setting
    • After activation, Loco Translate appears in the left menu of your dashboard. Click on it to access the plugin interface.
    • You can choose to translate themes or plugins by clicking on the corresponding tab.

Translate a theme or plugin

  1. Selecting the object to translate
    • In the “Themes” or “Plugins” tab, select the element you want to translate.
    • Click “Add new language” and select the target language for translation.
  2. Translation process
    • Loco Translate presents you with a list of character strings taken from the text domain of the theme or plugin.
    • Translate each string by entering the target language version in the appropriate field.
  3. Saving and managing translations
    • Once the translation is complete, click “Save” to save your language file.
    • Tip: Back up the translation file in your system to avoid loss if you accidentally delete the plugin.

Adjustments and best practices

Some strings may not be ready for translation if the theme or plugin has not been properly internationalized. In these cases, you may need to adjust the source code or use a child theme to add missing text domains. This ensures that all parts of your site can be translated and remain up to date after updates to the main theme.

Conclusion

With Loco Translate, translating your WordPress site becomes a simple and accessible task, even without in-depth technical skills. However, the quality of the translation strongly depends on the good preparation of your theme or plugin. Make sure everything is set up correctly to get the most out of this powerful localization tool. For more practical details, please see the tutorial video linked to this article, which will guide you through each step of the process. Contact us if you need assistance.