🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

WordPress Multilingual Plugin Polylang Usage Tutorial_Foreign Trade Multilingual Website Building

Foreign Trade Independent WebsitesOften involves multilingual issues, and the solution is usually to createmultilingual website, and Polylang is a free multilingualWordPress Plugin. This article introducesHow to Build a Multilingual Website Using Polylang. Before reading this article, you need to have aWordPress Installationwebsite, then you can install Polylang.

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演示

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.

You can use multiple languages as needed. Supports RTL language scripts. WordPress language packs are automatically downloaded and updated. You can translate posts, pages, media, categories, post tags, menus, widgets... Supports custom post types, custom taxonomies, sticky posts, and post formats, RSS, and all default WordPress widgets. Language can be set by content, by language code in the URL, or you can use a different domain for each language. When adding a new post or page translation, categories, post tags, and some other metadata are automatically copied. Customizable language switcher available as a widget or in the navigation menu.

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.polylang Download LinkYou may also want to read the following articles:
  1. WordPress Plugin Installation Tutorial: Comprehensive Guide to Popular Essential Plugins
  2. 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.多语言网站插件Polylang使用教程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.多语言网站插件Polylang使用教程③、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.多语言网站插件Polylang使用教程④、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.多语言网站插件Polylang使用教程⑤、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.多语言网站插件Polylang使用教程

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:Polylang菜单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: Polylang多语言切换按钮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:

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step instead.

「Naibabiji WordPress Website Building Coaching」 — From selecting a domain and purchasing hosting to installing themes and publishing posts, I「ll guide you through every step, helping you avoid detours and reach your goals directly.

👉 Learn about Website Building Coaching Service
🔒

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.

×
二维码

Scan to Follow