CozyStay Documentation

Translating rooms with Polylang

October 11, 2024

In this tutorial, we will provide simple instructions and key points to explain how to translate your “Rooms” (add multiple language versions for each “Room”) using the third-party plugin Polylang.

Polylang Installation & Set Up

Please check out the following tutorials from Polylang official documentation site:

  1. Polylang Installation
  2. Polylang Setup Wizard

Then check out this tutorial to get some basic and general understanding about using Polylang: Create a Bilingual / Multilingual site with Polylang.

Translating the Custom Post Type: Room

  1. Please navigate to Languages > Settings, find Custom post types and Taxonomies and click Settings.
  2. And then please make sure that you have ticked the checkbox for Rooms. And then click “Save Changes“.
  3. Navigate to Rooms > All Rooms. You will see a column with flags. Click on a “+” icon allows you to add a new translation for that room post. The “pen” icon means that a translation exists, and click on it allows you to edit the translation.

When translating a room post, you can edit and add all content just like creating a room post. Not all content needs to be translated one-to-one with other language versions. For example, the body content, you can use the WordPress editor or Elementor to edit any room post in a certain language version, the content is entirely up to you.

In the following subsections, we will briefly introduce how to use Polylang to translate some special elements related to room information.

Translating Room Type

  1. Please navigate to Languages > Settings, find Custom post types and Taxonomies and click Settings.
  2. And then please make sure that you have ticked the checkbox for “Custom taxonomies > Room Type”. And then click “Save Changes“.
  3. Navigate to Rooms > Room Type. Select a language in the top admin bar, and click the “+” icon to add a translation for an existing room type, for example, “Room”. After clicking the “+” icon, you will see the word “Room” automatically populated in the “Translations” field on the left side of the page. Then you can enter its translation in the “Name” field, set the Language version, and click “Add New Tag“. For example, we enter “Chambre” and set language to French.
  4. Then when you edit the French version of a room post, in the “Room Settings” panel > “General” > “Room Type“, you can add “Chambre” as its room type.

Room Facilities

We suggest not translating the room facilities – please refer to the screenshot below. You can create room facilities for all language ( not for a specific language ). And then enable the facilities and change labels when editing each room.

Please do NOT check this box
Change labels when editing each room.

Extra Services

  1. Please navigate to Languages > Settings, find Custom post types and Taxonomies and click Settings.
  2. And then please make sure that you have ticked the checkbox for “Custom taxonomies” > “Extra Services”. And then click “Save Changes“.
  3. Navigate to Rooms > Extra Services. Select a language in the top admin bar, and then create some Extra Services for this language.
  4. Select another language in the top admin bar and create Extra Services for that language. Repeat this step until you have created Extra Services for each language.
  5. When you are editing a room post in a certain language, in “Room Settings” > “Extra Services“, you can see the “Extra Services” you have created in that language version. Just select the items you want to display on the room post page.
Close
Close