Multi Language
Localizing and translating the theme
Section titled “Localizing and translating the theme”Every text that Ava prints on its own, such as button labels and headings in lists, is a string in the theme’s language file. All these strings are in one file, ava.pot, in the ava/languages folder of the theme. You translate them with the free Poedit program or with the Loco Translate plugin. The step-by-step instructions for both tools, including where to save the translated .po and .mo files, are in Translating theme strings.
Loco Translate
Section titled “Loco Translate”Loco Translate is a free plugin that lets you translate the file inside your WordPress admin, without any other program.
Poedit
Section titled “Poedit”With Poedit, you create a translation of ava.pot on your computer and upload it to the wp-content/themes/ava/languages folder over FTP. Name the files after the WordPress naming convention for language files, such as de_DE.po and de_DE.mo. If you use other names, the theme does not find your translations.
You can also use a translation file to change our English wording. Create en_US.po and en_US.mo with your own texts. This way you don’t need to change the theme’s core files for those strings.
WPML plugin
Section titled “WPML plugin”WPML (WordPress Multilingual) is a plugin that shows the same content in several languages. You don’t need a separate site for each language: one site (one domain) shows every page, post and portfolio item in each of your languages. How to install WPML, add languages and translate your content is explained in the shared guide Translating with WPML or Polylang. This section covers what is specific to Ava.
Changing languages
Section titled “Changing languages”When the plugin is active, Ava shows the language flags in the header, below the navigation. Your visitors click a flag to see the page in that language, if the page exists in that language.
- A page or post that has no translation in a language does not show in that language.
- Flags show only for the languages you have activated.
Translating pages and posts
Section titled “Translating pages and posts”- Create the page in your default language and finish its content, with the featured image, the other images and attachments. Then publish it.
- In the list of pages or posts, click the plus icon in the column of the language you want to add. You can also use the WPML translation editor.
- Write the content in the other language and publish the translation.
- Repeat these steps for each language.
Set WPML to show only translated content in each language. The theme does not support showing untranslated posts in a translated blog list. For help with theme-related WPML issues, create a support ticket in your dashboard.
WPML and categories
Section titled “WPML and categories”Like WordPress posts, some of Ava’s custom post types are grouped into categories of their own: Portfolio has Portfolio Categories and Testimonials has Testimonial Categories. To group and list posts by category:
- Create a post.
- Create a category.
- Assign the category to the post.
- Publish the post.
A category page lists all the posts in that category, in the sort order you chose. You can add categories to a menu, so that a click on the menu item shows the posts of that category. When you translate the category and its posts, each translated category page lists the translated posts in that 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 add-on
Section titled “WPML String Translation add-on”WPML comes with an add-on called String Translation. Ava registers many of its own fields with it, so you translate them there instead of creating duplicates of the content. You can read more about the add-on on wpml.org.
Not every string appears in String Translation.
Only the fields that the theme registers appear in the String Translation list, for example:
- The copyright text
- The slogan
- The social media links
- 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 explains how to show a different widget in a widget area for each language. Follow the WPML guide Translating widgets.
Support for the WPML plugin
Section titled “Support for the WPML plugin”We don’t provide support for how the WPML plugin itself works. WPML has its own support forum and documentation, where you can get free or paid help. We fix problems in our own theme code. The WPML documentation covers the common questions, including how WPML works with themes.
Polylang plugin
Section titled “Polylang plugin”Polylang is a free alternative to WPML. When you install it, the language switcher appears in the header, in the same place as with WPML. The plugin’s documentation is at polylang.pro/doc, and the shared guide Translating with WPML or Polylang covers the setup.
Get all RT-Themes designs, updates and support with a single Club license.
Join the Club