You’ll agree with me, a site intended for an English-speaking audience must be in English. WordPress themes and plugins are mostly in English, so you’re fine with that. But what if you want them translated into… French or Spanish or any other language?
If efforts are made to provide translations, especially for the most popular themes and plugins, the ones you choose may not have them, or may be only partially translated.
In this case, you’ll have to translate your theme or plugin, or get a translation to make your WordPress site accessible to your target audience.
As you can see, the goal of this article is to put these damn tools in your desired language! We’ll see how to do it easily, without touching a single line of code, thanks to a program called Poedit.
Ready to roll up your sleeves? Let’s go.
Overview
Originally written in March 2022, this post was last updated in February 2023.
Check out our guide about choosing a domain name. If needed, you can learn how to create a professional WordPress website thanks to our dedicated guide. And if you’re looking for a theme, look no further, here is our selection of the best free WordPress themes.
How to use Poedit?
Poedit is a software to translate your WordPress themes and plugins. It is not a plugin, but a tool external to WordPress.
There is a free version and a premium version, starting at €34.99 (i.e ± $38) for one year of use.
The translation is done through .po
and .mo
files, contained in the files of your WordPress site, and which contain the texts displayed within your theme or plugin.
It is also possible that a .pot
file is present, we will discuss this point later in this article.
Get the Poedit software:
The first thing to do, before proceeding with the translation, is to check the presence of these files. To do this, log in to your FTP if you work online.
If you are working locally, you’ll have to check in the software you are using.
With Local by Flywheel (a free solution that we recommend if you work locally), click on the arrow located just below the title of your site.
To learn how to install a WordPress site locally, see our article.
Then go to app > public, or “public/public-html” (the name of the folder depends on your host), then to wp-content > themes, and finally click on the name of your theme.
Translation files are usually located in a folder called “language”, inside the folder where your theme is located. Sometimes they are located directly in your theme folder, or in wp-content > languages > themes.
As a name, they have the code corresponding to the language of the theme. For example en_US.po
if your theme is in American English, or en_GB.po
if it is in British English. To know the code of your theme according to its language, check this list on the Astra theme site.
If you find several .po
files in your theme’s folder, it means that your theme has already been translated into these languages, and that you can edit these translations.
If you want to make your WordPress site multilingual, check out this article.
Translating your WordPress theme with Poedit
Your theme has a .po (and .mo) file
The .po
and .mo
files contain the same data, but in a different format. However, we will only deal with the .po
files, as they are the editable files in Poedit.
Download and open the .po
file of your theme with Poedit by right-clicking it.
Once loaded in Poedit, its content is displayed as a table. You will find the original text on the left and the translation on the right.
In the lower part of the window you can edit the translation of the selected word or phrase (we talk about word strings).
In the free version, Poedit offers the translation of the first 10 strings, which you can select in the bar on the far right. If you want to continue using this pre-translation beyond 10 strings, you have to upgrade to the Pro version.
Note that some strings are only visible in the WordPress admin interface so you may not need to translate them. However, you must make sure to translate all the strings that will be visible on the front office site (the interface visible to the user).
Now you just need to translate the rows of the table one by one. 😇
Relax though, you won’t have to translate everything. Sometimes there are “%
“, “$
” or even symbols like “→
“.
They correspond to numbers (to display %
comments for example) and specific characters. You can find the list on this page.
You can also find HTML code in the translation strings, just copy all these characters and replace only the English text with your desired language.
Note: The display of dates differs for our American friends. Please refer to this page to learn more about the date format that will best suit your site.
Finally, to make your work easier, Poedit suggests translations in the column on the right of the screen.
Once you’ve translated all these lines, you’ll need to save it all to a new translation file.
Go to File > Save As and name your file fr_FR.po
for French or es_ES.po
for Spanish (for Spain though because Spanish for Mexico would be es_MX.po
, and so on). For example, it would be fr_CA.po
for our Canadian friends. Save your file in the same location as your original .po
file.
In fact, you should save your new file after translating a few lines, then save it regularly by pressing “Ctrl” and “S” or “Command” and “S” at the same time if you are on a Mac. It would be a shame to start all over again if a problem occurs. 😉
Your theme has a .pot file
There is another case that can occur. This is the case where your theme does not contain a .po
file but a .pot
file. The next step will be to generate a .po
file from this .pot
file. Poedit has foreseen everything.
Open Poedit, click on “Create new…”, then on your .pot
file.
Then select the language you want to translate your theme into.
There you go, you now have a nice looking .po
file that you can translate using the first section of this article. 😉
Don’t forget to save your work regularly.
Translate your child theme
You now have the keys in hand to translate your theme with Poedit. However, if your theme is going to be updated, it will be better to do the translation in a child theme, so as not to risk losing your translation.
Well, I don’t hide it from you, you’ll have to manipulate a little bit of code for that. But you’ll see, nothing too complicated.
To know how to create a child theme, see our dedicated article.
First of all, create a folder named “languages” in the directory of your child theme, just like the folder located in your parent theme.
Open your .po
or .pot
file in Poedit, select the target language and translate the lines you want.
Once you’re done, go to File > Save As and enter the code of the language you’re translating your theme to.
Go to the “languages” folder of your child theme (/wp-content/themes/child-theme-name/languages, where “child-theme-name” is the name you gave to your child theme) and put the .po
and .mo
files generated by Poedit in there.
Finally, to ensure that the translation of the child theme is taken into account, insert this piece of code at the end of the functions.php
file of your child theme:
Replace “my_parent_theme” by the name of the parent theme’s folder, save your file, and you’re done!
Note: in some cases, the name of the parent theme’s folder won’t do the trick. You will have to open the style.css
file contained in the parent theme folder, and copy the name located after “Theme Name:” (line 2).
You can now come back to your site’s interface to see the result.
Translating your WordPress plugins with Poedit
You’ve understood everything about theme translation? Good news, it’s exactly the same for plugins! Even the translation files are located at the same place.
In short, you will find most of the time .po
and .mo
(or .pot
) files in the plugin folder, then in a “languages” folder. Sometimes they can also be found in the wp-content/languages/plugins folder.
Find the .po
file for your plugin (or convert the .pot
file to .po
), translate the lines that interest you, update it, and voilà!
Isn’t life great?
To conclude
You now know how to translate your WordPress theme and plugins with Poedit.
With Poedit, the translation process is simplified, all you have to do is translate the texts contained in the files and save them in the right folder inside your theme or plugin.
If your theme and plugins have been designed following good internationalization practices (if they contain the famous .po
or .pot
files), you don’t need to get your hands in the code to translate them.
We also appreciate the fact that the procedure is the same when it comes to translating WordPress themes and plugins.
That said, Poedit requires handling translation files, so possibly an FTP, and navigating between the folders of your WordPress installation, which can be laborious.
There are more convenient solutions in the ecosystem for translating your WordPress themes and plugins like Loco Translate, for example.
Now it’s time to give you the floor. Have you translated your theme or plugins with Poedit? If yes, what did you think about it? Tell us all about it in the comments. 🙂
Receive the next posts for free and access exclusive resources. More than 20,000 people have done it, why not you?
Continue reading
Articles posted in WordPress TutorialscPanel: Features and how to use this interface for your WordPress site
Need to modify the PHP version of your website? That’s where it happens. Need to create an email address? That’s where it happens too. Need to install an SSL certificate on short notice? Here again. Where? On your WordPress site’s…
How to redesign a WordPress website: the ultimate checklist
Aaah, the redesign of a WordPress website… When you think about the different issues that this mission involves, you usually tend to stress a bit. Who doesn’t dream, in this key moment, of doing a simple Command + Option +…
How to enable two-factor authentication on your WordPress site
A login + a password. Connecting to the WordPress administration interface is very simple, as long as you remember these two elements. From the point of view of the malicious person or robot that wants to access your site, it’s…