Anything that doesn’t fall inside posts, pages or taxonomy goes into String Translation. This includes the site’s tagline, general texts in Admin screens, widget titles and many other texts.
WPML’s String Translation module is part of the Multilingual CMS package. To enable it, you first need to download and install from your WPML.org account.
Then, go to WPML->String Translation.
Choosing Which Strings to Display
A complex site may contain many strings to translate. Use the display filter, at the top of the String Translation page, to determine which strings to display.
- Which strings to display – choose the translation status (everything, translation complete, translation needed or waiting for translator)
- Strings context – WPML organizes strings into different contexts, making it easier to find a specific string.
- Search – you can enter a search value to narrow down specific strings
Click on the translations link to open the translation editor.
Be sure to click on ‘translation is complete‘ after you translate. Incomplete translations will not appear in the site.
If you are using WPML’s Translation Management module, you can also send strings to translation by your translators.
Click on the checkboxes next to strings, select the language from the list (in the Translation options box) and choose to send to translation. Please note that you cannot choose a specific translator. All translators within a language pair would be able to translate the strings you’ve chosen.
Advanced String Translation Features
Besides the basic filter and translation features, WPML offers advanced options, which can make your site administration simpler.
Track when strings appear on the site
This option helps you identify where strings are used on public pages in the site. When enabled, WPML will keep record of the PHP source and pages that display each string. This feature can help understand the correct context of strings and how they should be translated.
Please note that this is a database-intense operation. You should only enable it when building the site.
Auto register strings for translation
WPML uses static code analysis to locate strings that require translation in the theme and plugins. In some cases, the static code-scan cannot reliably find all strings. This often happens when strings are generated using code (not really static).
By enabling the auto registration, WPML will record strings that need translation at display-time. The conservative option is to record strings when logged in as an administrator. This means that when a logged-in admin browses the site, WPML registers for translation any strings that are displayed.
This operation may increase the amount of database queries while strings are registering for translation.
Original language of strings
WPML’s String Translation works like GetText (just dynamic). It translates all strings from one language to others.
If your site’s default language is not English, and even if English is not used at all in your site, all hard-coded strings should still be in English. WPML will let you translate from English to your site’s languages.
This is because many other texts in your site are still hard-coded in English. This includes WordPress itself, most plugins and themes.
However, if you want to override this and set a different ‘original‘ language for strings, you may do so using this box.
If your site’s language is not English, you should read the complete FAQ on using String Translation with default language other than English.
Import / export .po
You can import translations from other sources and export your current translations using .po files. If you choose to export strings without their translations, the file extension will be .pot (Portable Object Template). If you choose to include translations, the extension would be .po.
When you import translations, you must choose the language to import to.
Translating strings in the wp_options table
Many themes and plugins store texts in the wp_options table. You can tell WPML to register these strings to translation.
To do this, click on Translate texts in admin screens. This will open a GUI, showing the strings that WPML finds in your site. The list will often be a tree, which you can expand and collapse.
Developers note: Theme and plugin authors may also include a language configuration file in their code, which tells WPML which strings to translate in the wp_options table. This can save a lot of time for end-users, configuring multilingual sites.