In this how-to article, we will provide simple explanations and points to explain how to make your WordPress site to be a bilingual/multilingual site when you are using our Eaven theme and the third-party plugin Polylang.
Please note: because Polylang is a third-party plugin, so we will only provide links to this plugin’s official documentation. We will not be able to provide details about how to use this plugin, or provide support service for this plugin.
Step 1 – Basic Knowledge
There are 3 types of content that need to be translated separately:
- Theme Strings: they are strings written in the theme code. Please continue reading to know more information in Step 2.
- Dynamic content: like posts, pages, categories, and user defined strings. To translate those content, you can use the Polylang plugin. Please continue reading to know more information in Step 3.
- Special – Home Widgets: Please continue reading to know more information in Step 4.
Resources of Polylang:
- Polylang Free Version: https://wordpress.org/plugins/polylang/
- Polylang Official Documentation: https://polylang.pro/doc-category/getting-started/
- Polylang FAQ: https://wordpress.org/plugins/polylang/#faq
Step 2 – Translate Theme Strings
Theme Strings: they are strings written in the theme code, for example, “Next Article” or “Previous Article” (post pagination) on each single post. To translate these strings, please follow this guide: How to translate Eaven theme.
Please make sure you have translated all the Theme Strings you need.
Please note: if you have imported demo data, then some strings are entered into the customizer during the demo importing process, then you will need to translate these strings by Polylang. Please see more details in “Step 3 – 2. Translate User Defined Strings”.
Step 3 – Translate Dynamic Content with Polylang
1. Create Languages
After installing Polylang, please create languages. For example, if your site will have 2 languages, English and German, you will need to create 2 languages, and set one of them to be the default language. Please read this article: https://polylang.pro/doc/create-languages/.
2. Translate User Defined Strings
Polylang allows you to translate user defined strings such as the site title, the tagline, or the widget titles. Moreover themes and plugins can allow you to translate their options here.
To translate User Defined String, you must use the Strings translations table of the Polylang plugin.
Please read this article: https://polylang.pro/doc/strings-translations/
There are 2 types of User Defined String:
- Strings entered with WordPress core features: such as the site title, the tagline, or the widget titles.
- Strings entered with theme and plugins. Please see more details below:
Theme Options Strings: They are strings entered in the theme options (customizer). When customizing your site with Eaven theme, you will be able to enter many custom text in the customizer. To translate any custom text you entered in the customizer you need to use Strings translations table of the Polylang plugin.
To locate Strings translations table: on your site admin panel > Languages > Strings Translations.
For example, you can change the text of “Read More” buttons to “Continue Reading”, or you can change the related posts section’s title “You May Also Like” to any other text like “Read more articles in this category”. After you have entered/modified custom text in the customizer, you can find these text shown in the Strings translations table.
3. Create menus
You have to create one menu per language and save them.
Please read this article: https://polylang.pro/doc/create-menus/
For all widgets you have now the possibility to choose to display it for all languages (default) or only one language. If you select “All languages” you will have the possibility to translate the title in the Strings translation option.
Please read this article: https://polylang.pro/doc/widgets/
Please note: for custom widget “Eaven Category”, you have to create one widget per language, because you have to choose different categories for each language.
5. Translating pages, posts, categories and tags
Please read this article: https://polylang.pro/doc/translating-pages-posts-categories-and-tags/
Step 4 – Translate Home Widgets
Eaven contains a built-in homepage drag and drop builder in the customizer to create a “Multi-content Homepage”. Please read our documentation to know more details about it: https://www.loftocean.com/eaven-doc/documentation.html#homepage
When creating a bilingual/multilingual site, you will need to create different home widgets for different languages.
For example, on the homepage, we have a home widget displaying the most viewed posts, this home widget has a title “Editors’ Picks”.
- Expand this home widget, you can find the option “The widget is displayed for:” at the bottom of its settings panel. Choose “English”.
- Add a new home widget > “Posts”, choose the same options as the home widget “Editors’ Picks”. Change the home widget title to “Redakteurfavoriten” (“Editors’ Picks” in German).
- Find the option “The widget is displayed for:” at the bottom of its settings panel. Choose “Deutsch”.
- Save changes and publish.