Multilanguage
Localizing and translating the theme
Section titled “Localizing and translating the theme”The theme’s default text strings are collected in one language file that comes with the theme. It is {theme_name}.pot in the {theme_name}/languages folder. You translate it with the free Loco Translate plugin in your WordPress admin, or with the Poedit desktop program. Translating theme strings walks through both, step by step.
Loco Translate
Section titled “Loco Translate”Loco Translate is a free plugin that lets you translate the theme’s strings in the WordPress admin, without editing files on your computer.
Poedit
Section titled “Poedit”With Poedit you create a translation of the .pot file on your computer. Name the files after your language code, following the WordPress naming convention, for example de_DE.po and de_DE.mo. If you use other names, the theme does not find your translation. Upload the files to the /wp-content/themes/{theme_name}/languages folder.
You can also use a translation to change the theme’s English wording. Create a translation called en_US.po and en_US.mo with your own wording. You do not need to edit the theme’s core files for these strings.
WPML plugin
Section titled “WPML plugin”WPML is a plugin that shows the same site in several languages. You keep one site on one domain, and each page, post, portfolio item or product has a version in every language. How to install WPML, add languages and translate content is explained in Translating with WPML or Polylang. This section covers what is specific to RT-Theme 19.
Changing languages
Section titled “Changing languages”When WPML is active, the theme shows a flag for each active language in its header area. Visitors click a flag to see the page in that language.
- A flag only shows for the languages you activated in WPML.
- If a page or post has no version in a language, it does not show in that language. A visitor who clicks that flag goes to the home page of the other language.
Translating pages and posts
Section titled “Translating pages and posts”- Create the page or post in your default language, with all its images and attachments, and publish it.
- In the list of pages or posts, click the plus icon in the column of the language you want. You can also translate the content in the WPML translation editor.
- Write the content in the other language and publish the translation.
- Repeat this for each language.
The original and its translations stay connected in WPML, but each translation has its own content, so you can change one without changing the others.
In the WPML settings for your post types, choose to show only translated items. Older WPML versions called this setting “Only translated posts”. The theme does not support showing untranslated posts in the other languages.
For help with theme-related WPML problems, create a support ticket in your dashboard.
Translating categories
Section titled “Translating categories”The theme’s custom post types, Portfolio, Product Showcase, Team and Testimonials, can be grouped into categories, just like WordPress posts. To list posts by category:
- Create a post.
- Create a category.
- Attach the category to the post.
- Publish the post.
A category page lists all posts in that category, in the sort order you chose. You can add categories to a menu, so a click on the menu item shows the list. When you translate the category and its posts, the translated category page lists the translated posts in the other language.
Create the categories and their translations for each language first. When you then translate a post that has a category, WPML already knows the translated category and assigns it to the translated post.
WPML String Translation
Section titled “WPML String Translation”WPML includes String Translation. It lets you translate texts that are not pages or posts, such as theme settings, without creating duplicates. RT-Theme 19 registers its own fields with String Translation, so you can translate them there. Read more about String Translation on wpml.org.
Only the strings that the theme registers show in String Translation. For example:
- The copyright text
- The slogan
- The social media settings
- The breadcrumb text
- And more
Different widgets per language
Section titled “Different widgets per language”Some widgets cannot be translated with String Translation. For those, show a different widget in each language. WPML explains how in its guide to translating widgets.
Support for WPML
Section titled “Support for WPML”WPML has its own support forum and documentation, with free and paid help. We fix problems in the theme’s own code. The WPML documentation answers most questions about how the plugin works with a theme.
Polylang plugin
Section titled “Polylang plugin”Polylang is a free alternative to WPML. When you install it, the language switcher appears in the header, just like with WPML. Setting it up is covered in Translating with WPML or Polylang and in the Polylang documentation.
Get all RT-Themes designs, updates and support with a single Club license.
Join the Club