Skip to content

[WordPress] Using “Polylang” to build a multi-lingual website

Today, I consider seriously to split my blog to Chinese version and English version. So, at the time of writing this article, I’ve set Polylang up. I was persuaded by my friends that there are two versions better, and second, it’s really because of OCD. I hope my articles in different languages can be separated and don’t always mix Chinese and English.

But “Polylang” is more complicated than I thought. Although I see everyone in internet is very easy to install (?), Of course this should be my understanding is very poor, hahahaha.

I will record this problem experience note with this article:

  • After installing Polylang, “categories”, “tags” are failed to display
  • How to set the articles to one of languages quickly (Default is none)
  • Corresponding two existed articles
  • Home Page error

Looking closely, I encountered a bunch of problems, no wonder it took a lot of time. But when I done, I feel very satisfied.

And let’s start!


What is “Polylang” ?

First, I need to introduce the plug-in “Polylang”.

Polylang is a famous WordPress plug-in, and its function is help us to make a multi-lingual website, and we can use just one button to switch language in “articles”, “categories”, “tags”.

And then, I will talk about how to install Poly and what problem I meet.


How to install Polylang

There is no any difficult point to install Polylang in WordPress.

Search “Polylang”, install it, startup it. We finished.


Categories is failed

Just looking at picture can be difficult to understand: My “Categories” is disappeared!

Here’s what is looks like:

So long.

Very miserable! After clicking the link, it will even run out of “No content” on screen. Fortunately, I usually have a good habit of backing up…… oh no, it’s too early to give up the backup so soon. At least, there is no problem in opening the article link from the backend.

When I checked the Internet, many people really encountered this problem: https://wordpress.org/support/topic/language-switcher-not-working-on-categories/

According to people in the discussion board, this is actually “normal”. After enabling multilingualism, you must actively set the “Language” for all “Categories”, “tags”, and “Articles”, otherwise it will not display properly.

Open the Languages options in your admin menu left bar.

In here, we need to add a new language we want to set. For example, I want to use two languages: “Chinese” and “English”, so I need to add two languages:

Because my blog default language is Chinese, so my Chinese order set to 0.

Add the language you need, go to the “Categories” or “Tags”. In here we need to set the corresponding language.

If I set the original tag to “Chinese”, and we will see another field is “+”. Clicked it and we can add a new language tag to corresponding the old one. You can look at my photo.

“Categories” requires the same operation to display properly on the website.


Set the articles

The next part I always thought it was difficult: the part of “articles”. Before we started to build the multi-lingual website, we my already have hundreds or even thousands of articles. Well, we will spend a week assuming we set it one by one.

Fortunately, we can set all languages by batch processing.

If you have some existed another language articles, we can process them wait for a while, select batch process.

“Edit” => “Apply”, and we can set language property for all articles in one ago!


The same article in different langauges

If you have written a new article or you have no corresponding another article, it is actually very easy to set the corresponding version.

When you edit an article, open the right bar and you can set the language of this article. Click the flag’s “+” and the WordPress will open a new page. You can translate the article right now.

But if you have a existed corresponding another language article?

It’s not difficult. You can enter the title of article in the input box next to “+” and the system will automatically search for the title of the article you have written.

For example:

Press “Update” button, and the two articles are linked.

This is my Chinese article, press the right side English button:

The page will switch to English article!

By the way, after installing “Polylang”, you have to add the tool “Language Switcher”.


Home page links in other language fail

Although it is going well now, I still encountered the final problem.

Here is my English website, but when I click my “Home Page”, a big error occur.

Home page is not converted! and it link to a strange site! Polylang Document lie me (Actually I misunderstood them)! I tried searching for a solution, someone asked, but nobody answered.

I open my “cpanel” to check the my folder:

This is actually a folder I made myself.

It turned out that I used the “multi-site” blog in the past, and I used “en” sub-domain. It may conflict with Polylang.

So I change my language code to “us”. (This is very strange I know.)

The result was successfully displayed!


Postscript

That’s it, my difficult Polylang setup is over, and by the way, my vacation is over.

Although English writing is not good, establishing a multilingual blog is still very happy.


Reference

Tags:

Leave a Reply