When it comes to translating a website, you probably think of the main text that makes up your posts and pages. However, unless you know how to translate a WordPress theme, parts of your site provided by this component will remain in English.
By translating your WordPress theme, you’ll be able to localize every aspect of your site to put visitors who don’t speak English. This could increase your conversion rate and boost your revenue.
In this tutorial, we’ll discuss the differences between translating a theme versus your website’s content. Then we’ll show you how to do so in four steps. Let’s get right to it!
An Introduction to WordPress Theme Translation
To fully localize a website, you need to translate its content as well as components such as your theme and plugins. That means all the posts and pages on your site, but also all the elements your theme provides.
Take our theme Kale Pro, for example. If you’re using it to run a food blog, then you’ll see snippets of your latest posts on the front page:
If you translate that content, then the excerpts should appear in the new language. However, elements such as your About Me widget, social links, forms, and more will remain in English unless you know how to translate a WordPress theme:
There are two steps to translating a theme you’ll need to consider before you get started. First, you have to decide how you will translate your site from a language standpoint. Options include:
- Hiring a translator to do it for you
- Automating the content translation process with a plugin
- Manually translating your content and theme strings on your own
Additionally, there are multiple ways to carry out the technical side of translation, which involves modifying your site’s files. Some use an editing platform such as Poedit. However, its often easier to install a plugin that can help you with this process.
Keep in mind, you’ll still need to decide how to approach content translation, but that’s a topic for another article.
How to Translate a WordPress Theme (In 4 Steps)
For this article, we’re going to focus on the plugin-assisted manual approach to theme translation. If you’re fluent in your target language, this is the easiest, most accurate, and most affordable method. Here’s how to get started.
Step 1: Choose a Theme that’s Ready for Translation
Not every WordPress theme is ready for translation. It’s important to make sure yours is, or you won’t be able to proceed. In most cases, a theme’s description will mention if it includes the necessary files:
Translation-ready themes include all their strings (the bits of interface text added throughout your site) in files that are easily accessible. Localization files most often use these three extensions:
Take our Kale Pro theme, for example. If you look through its files, you’ll see a folder called languages, which includes a kale.pot file. That file contains all the theme’s strings, including those used in the WordPress Customizer and for front end text:
If you open that file using a text editor such as Poedit, you can see those strings firsthand. However, we’re going to modify them using a theme translation plugin.
Step 2: Install a Localization Plugin
There are a lot of localization plugins you can use, but our favorite is Loco Translate. It provides access to a simple editor that enables you to translate theme strings quickly:
The plugin includes a lot of features to make your work easier. It enables you to create backups of your translation files, save custom localizations in private folders, mark strings that are complex, and more.
Go ahead and install and activate Loco Translate. It doesn’t require any configuration, so you can move right along to the next step.
Step 3: Translate Your Theme’s Strings
Once the plugin is active, go to the Loco Translate tab in your dashboard and select Themes. Here you’ll see a list of all the themes installed on your website. For this tutorial, we’re going to translate Kale Pro, so we’ll select that option:
On the next page, you can see a list of all the existing translations for your theme – right now it should be empty. Click on New language to add one:
Next, select the language you want to translate your theme into. Loco Translate lists all the options WordPress supports natively, but you can also select Custom language if you’re aiming for an obscure dialect that’s not included:
Then, you need to specify a location for Loco Translate to save your translation files in:
In most cases, it’s best to select Custom since that enables you to save your translation files in a new folder that won’t be overwritten when you update your theme. Now click on the Start translating button.
Finally, it’s time to get to work. Loco Translate will enable you to access a list of strings provided by your theme, which you’ll need to translate one by one. Clicking on each string will bring up the source text and a field where you can type your translation in:
Depending on the scope of your theme, this process can take a while. At any time, you can click on the Save button to save your work so far and come back to it later. If you move to the File info tab, Loco Translate will show you an overview of your progress:
Keep in mind, your theme won’t switch to your new language automatically. You can take your time working on each translation to ensure your text is accurate and optimized for your target audience.
Step 4: Switch Your Theme’s Language Through Your Dashboard
Once Loco Translate shows your progress to be 100 percent and you’ve checked your work for accuracy, you can easily switch your site to your new language. This process is simple from a technical standpoint. All you have to do is navigate to Settings > General in your dashboard:
Then, scroll down to the Site Language option and select your target language from the dropdown. Save your settings, and WordPress will switch the language of your site on the front end as well as in your dashboard.
However, keep in mind that this won’t change your site’s content, such as the body text or titles of your blog posts. It also won’t translate any theme strings you left incomplete in Step 3, or any interface text provided by plugins on your site.
Translating a WordPress theme can take a while, depending on how many strings it uses. It’s hard work, but you only have to do it once. When you’re done, you can enjoy using your language of choice across your website.
If you’re ready to start translating, here are the four steps you need to take to localize your WordPress theme:
- Choose a theme that’s ready for translation.
- Set up a localization plugin such as Loco Translate.
- Translate your theme’s strings.
- Switch your theme’s language through the dashboard.
Do you have any questions about how to translate a WordPress theme? Let’s talk about them in the comments section below!