In this tutorial, 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 CozyStay theme and the third-party plugin Polylang.
If you want to use WPML, please read this tutorial.
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 several different 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.
- Newsletter Signup Form: Please find the details 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 (included in the .pot file), for example, “Join the Conversation” (Comments Section Title) on each single post or page. To translate these strings, please follow this guide: Translating the 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
- Setup wizard: When activating Polylang for the first time, the setup wizard is automatically launched with all the necessary steps to configure more easily a multilingual website. You should follow each step one by one until you reach the “Ready!” step at the end of the setup wizard. Please read this article for details: https://polylang.pro/doc/setup-wizard/.
- 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 CozyStay 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 “Other Posts You May Enjoy” 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.
- Create Menus
You have to create one menu per language and save them. Please read this article: https://polylang.pro/doc/create-menus/. - About Widgets
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 CozyStay Category, you have to create one widget per language, because you have to choose different categories for each language.
- Translating pages, posts, categories and tags
Please read this article: https://polylang.pro/doc/translating-pages-posts-categories-and-tags/. - Translating Custom Post Types: Including Site Headers, Custom Blocks and Rooms.
Please navigate to Languages > Settings, find Custom post types and Taxonomies and click Settings.And then please make sure that you have ticked the checkboxes for Custom Blocks, Header Builder and Rooms. - After that, you can translate the Custom Blocks, Site Headers and Rooms just like translating pages or posts.
Step 4 – Translate Newsletter Signup Form
On your website dashboard, please go to CozyStay Dashboard > Integrations, you will find the MC4WP Multilingual Manager for Polylang. This option will show when Polylang and MC4WP are installed and activated.
- If you are using the premium version of the “MailChimp for WordPress” plugin, you can create multiple forms. Therefore, please create different forms for each language, and then select a different form for each language on this page.
- If you are using the free version of the “MailChimp for WordPress” plugin, you can only create one form. Then, please click the Translate the Form link to translate this form into another language.You will be redirected to the form edit page. You just need to edit the form title, content and messages into the target language. And save the changes.