Multilanguage
Localizing and translating the theme
Section titled “Localizing and translating the theme”The theme’s own texts, such as button labels and headings, are default strings in the theme’s language file. You find it at rt-theme-20/languages/rt-theme-20.pot. You can translate these strings with a plugin such as Loco Translate, or with the Poedit program on your computer.
The translation files must follow 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 files made with Poedit into the wp-content/themes/rt-theme-20/languages folder.
You can also use a translation file to change the theme’s English wording. Create en_US.po and en_US.mo with your own wording. There is no need to change the theme’s core files for these strings.
The full, current steps for Loco Translate and Poedit are in Translating theme strings.
WPML lets one site show the same content in several languages. You do not need a separate site for each language: you run one site on one domain and show every page, post and product in each language. How to set up WPML, translate a page and translate menus is explained in Translating with WPML or Polylang. This section covers what is specific to RT-Theme 20.
Changing languages
Section titled “Changing languages”When WPML is active, the theme shows the language flags on your site, below the navigation. Visitors click a flag to view the page in that language.
- Flags appear only for the languages you activated in WPML.
- A page or post that has no translation in a language does not show in that language. Visitors who switch language on such a page go to the home page of the other language.
Translating a page or post
Section titled “Translating a page or post”- Finish the page in your default language, including its featured image, other images and attachments, and publish it.
- In the post or page list, click the plus icon in the column of the other language. You can also translate the page with the WPML translation editor.
- Translate the content and publish the translation.
- Repeat for each language.
Show only translated blog posts. In WPML’s post type settings, set posts to show only translated items. The theme does not support showing untranslated posts in the other languages. For help with theme-related WPML issues, create a support ticket in your dashboard.
Categories and the theme’s post types
Section titled “Categories and the theme’s post types”Besides WordPress posts, the theme has custom post types that you translate in the same way: Product Showcase (with Product Categories), Team and Testimonials (with Testimonial Categories). Like WordPress posts, they can be grouped into categories. 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 attached to that category in the order you chose. You can add categories to a menu, so that a click shows the list of posts in that category. 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 first. When you then translate a post that belongs to a category, WPML already knows the translated category and assigns it to the translated post.
String translation
Section titled “String translation”WPML comes with an add-on called String Translation. RT-Theme 20 registers its own fields with it, so you can translate them there instead of creating copies of the content. You can read more about the add-on on wpml.org.
Only the fields the theme registers appear in the String Translation list, for example:
- the copyright text;
- the slogan;
- the social media texts;
- the breadcrumb text;
- and many more.
Different widgets per language
Section titled “Different widgets per language”For widgets that string translation does not cover, WPML recommends plugins such as Widget Logic, which show a widget in a widget area only for a certain language. See the WPML guide Translating widgets.
Support for WPML
Section titled “Support for WPML”WPML has its own documentation and support forum, so ask there how the plugin works; we support problems in the theme’s own code.
Polylang
Section titled “Polylang”Polylang is a free alternative to WPML. When you install it, its language menu appears in the header, the same as with WPML. The plugin has its own Polylang documentation, and the general steps are in Translating with WPML or Polylang.
Get all RT-Themes designs, updates and support with a single Club license.
Join the Club