Polylang Demo
The effect shown in the image below was recorded by Naiba after testing on November 14th. On the same website, clicking the language switch icon automatically changes the website content to Chinese or English.
Polylang Introduction
Polylang is aWordPress Website Buildingon theFreeplatform for creating multilingual website versions. It allows you to create bilingual or multilingual WordPress websites. After writing posts, pages, and creating categories and post tags normally, you can create content in other languages for them.If you don't have a WordPress website yet, you can follow the articles on Naibabiji tobuild a website yourself, which takes less than 3 hours.
Polylang Download Address
You can directly search for Polylang in the WordPress Admin Dashboard Plugin interface to install it, or download and install it via the link below.
Download LinkYou may also want to read the following articles:- WordPress Plugin Installation Tutorial: Comprehensive Guide to Popular Essential Plugins
- WordPress 429 Too Many Requests Error: Methods for Updating Themes and Plugins
Polylang Tutorial
①、After installing thePolylang Multilingual Plugin, a Language option will appear in the left menu of WP Admin. Go in and first add languages. Add whichever languages you need. Naiba here demonstrates adding English and Chinese.
Tip: After adding multiple country languages, click the ⭐ star icon in the multilingual list to set which language is the website's default language. ②、After adding, switch to String Translation. You'll see translation content for your selected languages by default. Just translate the content into what should be displayed.
③、Set the URL format. Usually, the second option is recommended, where the language is set based on the directory name in the link. This results in an effect like adding /en to the website URL. If you choose the domain format, remember to set up the domain resolution first.
④、After setup, in the post list, page list, or tag list, you will see an interface like the image below. The checkmarks represent posts that have been translated (default language). Clicking the plus sign next to them will add a translation post in the corresponding language. After you add it, the plus sign will change to a pen icon.
⑤、When we publish articles normally, first publish an article in the default language, then click the plus sign under 'Translate' to create a new article in another language, and publish it.
How to Translate Menus with Polylang
Some friends, afterBuilding a multilingual website, will find thatPolylang does not translate menus. This is because you haven't separately set up the multilingual aspect for menus. After installing Polylang, in the WP Menu settings, menu items for your selected languages will appear. You need to create a separate menu for each language. You can use the same menu name followed by the language to distinguish which menu content is used for each menu. As shown in the image below:
After setup, the menu will also change when switching languages on the website frontend.Polylang Language Switcher Not Showing
After you complete all multilingual translations, when you visit the website, you find thatPolylang Language Switcher Not ShowingThis is because you haven't added the option for a multilingual switcher button to the website.The method to add the Polylang language switcher button is as follows:
If you are using anWordPress ThemeIf there is no widget and you want to add the language switcher button to the website header or anywhere else, you can use the following code to call and output it:// 输出ul形式的多语言切换按钮
// 输出下拉选框的多语言切换按钮
$array = array(
'dropdown' => 1
);
pll_the_languages($array);
?>$array可选参数 'dropdown'=>如果设置为0,则显示列表;如果设置为1,则显示下拉列表(默认值:0) 'show_names'=>如果设置为1,则显示语言名称(默认值:1) 'display_names_as'=>'name'或'slug'(默认:'name') 'show_flags'=>如果设置为1,则显示标志(默认值:0) 'hide_if_empty'=>如果设置为1,则隐藏没有帖子(或页面)的语言(默认值:1) 'force_home'=>强制链接到主页,如果设置为1(默认值:0) 'echo'=>回声如果设置为1,则返回一个字符串,如果设置为0(默认值:1) 'hide_if_no_translation'=>如果设置为1,则不存在翻译时隐藏语言(默认值:0) 'hide_current'=>如果设置为1,则隐藏当前语言(默认值:0) 'post_id'=> if set,显示由post_id定义的帖子(或页面)翻译的链接(默认值:空) 'raw'=>使用它来创建您自己的自定义语言切换器(默认值:0)The above is the complete content for building a multilingual foreign trade website using Polylang. If you want to translate every piece of content with Polylang, it's recommended to find several editors to help; otherwise, for websites with many posts, the workload is too large. Polylang also has automatic translation extensions, but the quality of automatic translation certainly cannot match that of manual translation. For multilingual foreign trade enterprise websites, it's better to be more rigorous.Related articles:

Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.