In search of plugins and a theme for WordPress that you can translate?

The content of your themes and plugins can be translated to increase traffic, foster client loyalty, and increase conversion rates.

 

A challenging task, especially if you have no prior experience, might be translation. But if you have the correct instrument to help you, there is nothing to worry about.

This tutorial will provide the easiest methods for translating your theme and plugins. WordPress translation plugin – TranslatePress.

With the help of the strong translation plugin TranslatePress, translating your website will seem simple.

Let’s look at how themes and plugins are made translation-ready and what to do if they are not before we outline the precise procedures you need to follow to use TranslatePress.

Let’s begin!

Are Your Theme and Plugins Translation-Ready?

The term “translation-ready” in the context of WordPress refers to a theme or plugin that has been constructed in a way that makes it simple for users to translate its content into various languages.

It doesn’t mean that the plugin or theme can automatically translate. The theme or plugin appears to allow translations and is open to contributions from developers. You would still require a third-party tool because it won’t be able to translate itself.  (like a WordPress multilingual plugin) to fully translate the theme or plugin into different languages.

For a theme or plugin to be translation ready, the following has to be in place:

  • Gettext localization function added to the theme or plugin’s code;
  • POT file added to the theme or plugin folder.

What is the Gettext Localization Function

Let’s just say that developers add something called the gettext localization function to their theme or plugin’s code to make the tool translation ready.

For instance, your current theme may have the text string “Read more” displayed on the archive pages of your WordPress website.

Read more text translation in WordPress

This is a string that comes with the theme, as opposed to a blog post content that is user-generated.

If you go to the backend of your website and inspect your theme’s code, the text string would appear either like this:

<p>Read more</p> 

Or like this:

<p><?php _e( 'Read more' ); ?></p>

The former text string is an ordinary code snippet. The latter is wrapped in the gettext localization function.

The first snippet tells WordPress to display the text as it is; meaning, the text will appear as “Read more” even if you changed the site’s default language to Swedish.

The latter code snippet enables WordPress to recognize “Read more” as an English text and instructs the content management system to transform the text string to its Swedish equivalent when the site’s language is changed to Swedish. If a Swedish PO file is included with the theme, that is. However, we’ll discuss it soon.

In order to make themes and plugins translation-ready, it is crucial that text strings in such components be wrapped in gettext.

What is the POT File

The POT file, which is located inside the theme or plugin folder, includes the theme’s or plugin’s (for example, English) default text strings, such as Read more, Next page, Add, and Remove.

Developers and contributors can locate the theme’s or plugin’s default strings in this file and offer translations for them. To translate and produce crucial language files named PO or MO, they rely on the POT file.

 

The POT file essentially serves as a model for further translations.

What are PO & MO Files

The original text strings from the POT files are included in PO files along with their corresponding translated counterparts for each language. In other words, they add translations to the template.

The same information found in PO files is also found in MO files, but in a machine-readable (WordPress-friendly) format. WordPress makes use of this file to show users the translated content on the front end of the website.

You are surely aware by now of the significance of the POT file and the gettext localization function in a WordPress theme or plugin.

What happens, though, if your plugin or theme doesn’t support translations? What if they are not prepared for translation?

What if Your Theme or Plugins are Not Translation-Ready?

Fortunately, both translation-ready and non-translation-ready themes and plugins may be translated using the TranslatePress plugin.

The plugin provides both automatic and manual translation techniques.

The manual technique can be completed from the beginning by a professional translator, but it will take a little longer depending on the size of the site. Automatic translation is much faster, but it necessitates extensive proofreading.

In the part after this, we’ll demonstrate how everything functions.

How to Translate a WordPress Theme & Plugin

As mentioned earlier, we are going to use the TranslatePress plugin to demonstrate how to translate a WordPress theme or plugin.

Here’s what needs to be done:

Step 1: Install & Activate the TranslatePress Plugin

TranslatePress is one of the best translation plugins out there. With its user-friendly interface and intuitive features, TranslatePress makes the process of translating themes and plugins a breeze.

The plugin not only allows automatic translation of content but also provides the option to manually translate from the front end with the help of a real-time preview of the website.

One of the standout features of TranslatePress is the ability to translate all types of content, from text strings, to images, and even dynamically displayed elements.

TranslatePress has a free and a premium version. The free version offers all the features you need to translate your WordPress themes and plugins into one additional language. But if you need more languages or additional features, you can grab the premium version of TranslatePress.

We will be using the free version for this tutorial. So, to install the plugin on your website, download the free TranslatePress plugin from the WordPress repository.

Open your WordPress dashboard and go to Plugins > Add New and write “TranslatePress” in the search bar. When the plugin appears on the screen, hit the Install Now and Activate buttons, consecutively.

Installing TranslatePress for WordPress theme translation

Step 2: Choose a Second Language

After activating the plugin, go to Settings > TranslatePress > General > All Languages.

Under All Languages, there is a dropdown menu. From that menu, select the language you want to translate your theme and plugins into and hit the Add button.

Scroll down to the end of the page and hit the Save Changes button to save your settings.

TranslatePress language settings

The free TranslatePress plugin allows you to add a single second language to your website. To be able to add more translation languages, you will need the premium plugin.

NOTE: If you can’t find the language of your choice you can always add a custom language by going to Settings > TranslatePress > Advanced > Custom Language. Fill in the details of your custom language and hit the Save Changes button.

Advanced TranslatePress settings for custom languages

Now, if your theme or plugins have already been translated to your chosen language (meaning they already have PO and MO files for that language), TranslatePress will fetch those translations for you from the start.

This means that default text, such as “Read more” or “Add to cart” buttons, 404 page content, “Next post” and “Previous post” links will be translated from the get-go.

But what about the rest of the content, the content you input on your site? Or even the themes and plugins that are not translation-ready?

Well, that’s what we’ll tackle in the following sections of this post.

Step 3: Implement Automatic or Manual Translations

We mentioned earlier how TranslatePress offers automatic as well as manual translations. You can use them separately or you can even use them together.

Automatic translations are done through the Google Translate or DeepL APIs, while manual translations can be done by you or a professional translator, using a visual translation editor. But we’ll get back to that in a minute.

It’s worth noting that the manual translation method can also be implemented when you want to correct inaccurate automatic translations.

i. Translate WordPress Theme and Plugins Automatically

Before we dive into the method note that after you enable this feature, automatic translation will be implemented throughout your website.

If you don’t want to automate the translation of your ENTIRE website, then it’s better to implement manual translation which we have covered in the next section.

To enable TranslatePress’ automatic translation, go to Settings > TranslatePress > Automatic Translation. From the dropdown menu adjacent to the Enable Automatic Translation option choose Yes.

TranslatePress automatic translation settings

Next, select a translation engine: Google Translate or DeepL.

Translation Engines are machine translation systems that use artificial intelligence to automatically translate text from one language to another.

Both Google Translate and DeepL are powerful translation engines. Google Translation is available for free (for translation of up to 500,000 characters/month), while DeepL requires the premium version of the plugin.

Choosing between Google Translate and DeepL for automated translation

Whichever translation engine you choose, you need to fetch an API to connect it with your website. These help docs will assist you in generating a Google Translate API and a DeepL API.

As soon as you add the API and save your changes, automatic translation will be enabled on your website.

As mentioned earlier, automatic translations translate everything on your website including the theme and plugins content. The translations are triggered only when someone visits your site in your secondary language for the first time. The translations are then stored in your own database so you can never lose access to them, even if you choose to disable automatic translation at some point.

NOTE: TranslatePress adds a language switcher to the site so your visitors can easily switch between the languages available on your website and browse it in the one they prefer.

Ecommerce website translation example with language switching

ii. Translate WordPress Theme and Plugins Manually

To manually translate your theme and plugins content, open a post or page and select the Translate Page option from the admin bar.

Frontend translation options for TranslatePress

You will see the visual translation editor on the left side of the screen and a preview of your site on the right. You will use this editor to manually translate content on your WordPress website.

Live translation editing using TranslatePress

Hover your cursor over the piece of content you want to translate and select the pen icon displayed adjacent to the text. The text will appear in the translation editor along with an empty field underneath where you can add the corresponding translated text.

Remember to hit the Save button to save the translation.

Read time live content translation using TranslatePress WordPress plugin

You can do the same for all of the content on your site, including images, forms, buttons, and pretty much anything your theme or plugins display on the site.

That’s it. That’s how you can translate a WordPress theme or plugin.

That’s How You Translate Your WordPress Themes and Plugins

Translating a WordPress theme or plugin is a great way to draw more visitors and boost your conversation rates. You typically need your theme and plugin to be translation-ready but a powerful tool like TranslatePress can even translate plugins and themes that aren’t.

Besides translating themes and plugins, you can use TranslatePress to translate the rest of your site content too. You can translate your entire website and even your WooCommerce store.

You can first give it a spin using the free version of the plugin. Then, when you’re ready to take your multilingual site to the next level, you can choose a premium plan and translate even further. You’ll be able to tackle SEO elements, URL slugs, use powerful add-ons, and add unlimited languages. All to widen your website’s reach and grow its international traffic.