wordpress 多语言切换_wordpress

wpml cms

Do you want to make your website available in multiple languages? By default, WordPress does not come with features required to create a proper multilingual site. That’s why in this tutorial, we will show you how to create a multilingual WordPress site with the popular WPML plugin.

您想以多种语言提供您的网站吗? 默认情况下,WordPress不具备创建适当的多语言站点所需的功能。 这就是为什么在本教程中,我们将向您展示如何使用流行的WPML插件创建多语言WordPress网站。

wordpress 多语言切换_大数据_02

(Why Create a Multilingual WordPress Site Using WPML?)

You can use WordPress in any language that you want. It is super easy to create a website in any single language.

您可以使用所需的任何语言来使用WordPress 。 创建任何一种语言的网站都非常容易。

Most popular WordPress themes and plugins are also translation ready which makes it easy for anyone in the world to start a WordPress site in their language.

最受欢迎的WordPress主题和插件也已准备好翻译 ,这使世界上任何人都可以轻松地以其语言启动WordPress网站。

However, by default WordPress can support only one language at a time. What if you wanted to use multiple languages on a site to attact a much wider audience?

但是,默认情况下,WordPress一次只能支持一种语言。 如果您想在网站上使用多种语言来吸引更多的受众,该怎么办?

Governments, international businesses, and educational institutes often need to offer their website in multiple languages. While machine translations like Google Translate is an option, it’s often not acceptable for most professional organizations.

政府,国际企业和教育机构经常需要以多种语言提供其网站。 尽管可以选择Google翻译这样的机器翻译,但大多数专业组织通常不接受。

One way to offer multiple language options is to install WordPress in subdomains for each language. This is a lot of hassle, as you will have to manage updates, and backup all those installations.

提供多种语言选项的一种方法是将WordPress安装在每种语言的子域中。 这很麻烦,因为您将不得不管理更新并备份所有这些安装。

WPML (WordPress Multilingual Plugin) solves this problem by allowing your website to become multilingual. You can use the same WordPress installation to create content into many different languages.

WPML (WordPress多语言插件)通过允许您的网站变为多语言来解决此问题。 您可以使用相同的WordPress安装将内容创建为多种不同的语言。

It offers an easy to use interface for managing translations. It also adds language switching options for your users.

它提供了易于使用的界面来管理翻译。 它还为您的用户添加语言切换选项。

Having said that, let’s see how you can create a multilingual WordPress website with WPML in minutes.

话虽如此,让我们看看如何在几分钟内使用WPML创建多语言WordPress网站。

(Creating a Multilingual WordPress Site with WPML)

First thing you need to do is install and activate the WPML (WordPress Multi-language) plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您需要做的第一件事是安装并激活WPML(WordPress多语言)插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Note: WPML is a paid plugin, but it’s by far the most comprehensive option. There is a reason why over 400,000 websites use WPML for creating a multilingual WordPress site.

注意: WPML是付费插件,但这是迄今为止最全面的选择。 有超过40万个网站使用WPML创建多语言WordPress网站的原因。

Upon activation, the plugin will add a new menu item labeled ‘WPML’ in your WordPress menu. Clicking on it for the first time will take you to plugin’s settings wizard.

激活后,该插件将在您的WordPress菜单中添加一个标有“ WPML”的新菜单项。 第一次单击它将带您进入插件的设置向导。

wordpress 多语言切换_大数据_03

WPML will automatically detect your WordPress site’s language. You can change it here now if you want.

WPML将自动检测您的WordPress网站的语言。 您可以根据需要在此处进行更改。

Click on the next button to continue.

单击下一步按钮继续。

On the next screen, you will be asked to select the languages you want to enable on your site. Simply select the languages from the list that you want to add to your site.

在下一个屏幕上,将要求您选择要在站点上启用的语言。 只需从列表中选择要添加到站点的语言。

wordpress 多语言切换_python_04

You can always add or remove languages later if you need. After selecting your site languages, click on the next button.

如果需要,您以后随时可以添加或删除语言。 选择站点语言后,单击下一步按钮。

Now you will be asked to add a language switcher to your site. This language switcher will allow your users to choose a language to view content in their preferred language.

现在,将要求您向您的站点添加语言切换器。 使用此语言切换器,您的用户可以选择一种语言,以其首选语言查看内容。

wordpress 多语言切换_python_05

WPML allows you to automatically add content switcher as a sidebar widget, in your navigation menu, or display as a plain list.

WPML允许您在导航菜单中自动将内容切换器添加为侧边栏小部件,或显示为纯列表。

Additionally, you can also choose to select flags or text for language switcher. Once you have made the choice, click on the next button.

此外,您还可以选择为语言切换器选择标志或文本。 做出选择后,单击下一步按钮。

As the final step, you will be asked to enter your site key. If you have not generated one yet, then you can click on ‘Generate a key for this site’ button.

最后一步,将要求您输入站点密钥。 如果尚未生成一个,则可以单击“为此站点生成密钥”按钮。

wordpress 多语言切换_wordpress_06

This will take you to WPML website, where you will be asked to add the site you are coming from to your WPML account.

这将带您进入WPML网站,系统将要求您将您来自的网站添加到WPML帐户中。

Once your site is added, you can click on it to get to your site key. Copy and paste this key into your WordPress site.

添加站点后,您可以单击它以获取站点密钥。 将此密钥复制并粘贴到您的WordPress网站中。

That’s all you have successfully finished the WPML setup wizard. You can now click on the Finish button to exit the setup.

这就是您成功完成WPML设置向导的全部。 现在,您可以单击完成按钮以退出设置。

(Adding Multilingual Content into WordPress with WPML)

WPML makes it really easy to translate every area of your WordPress site into multiple languages.

WPML可以非常轻松地将WordPress网站的每个区域翻译成多种语言。

You will be able to easily translate your WordPress posts, pages, tags, categories, and themes into as many languages as you like.

您将能够轻松地将WordPress帖子,页面,标签,类别和主题翻译成所需的多种语言。

(Adding Multilingual Posts and Pages)

Simply click on the posts menu to view your existing posts. You will notice the languages columns next to your post titles.

只需单击帖子菜单即可查看您现有的帖子。 您会注意到帖子标题旁边的语言列。

wordpress 多语言切换_大数据_07

WPML assumes that your existing content is in your site’s primary language. It will show Add buttons for each language next to your posts. Click on the add button under a language to translate a post.

WPML假定您现有的内容是您网站的主要语言。 帖子旁边会显示每种语言的添加按钮。 单击语言下方的添加按钮以翻译帖子。

You can also manage translations by editing a post.

您还可以通过编辑帖子来管理翻译。

On the post edit screen, you will notice the new ‘Language’ meta box to manage translations.

在帖子编辑屏幕上,您会注意到新的“语言”元框来管理翻译。

wordpress 多语言切换_大数据_08

You can add translated content yourself or you can add users and authors to your WordPress site and have them translate your content for you.

您可以自己添加翻译后的内容,也可以将用户和作者添加到WordPress网站,并让他们为您翻译内容。

WPML also offers a better way to manage users who work as translators on your website. If you purchase their Multilingual CMS Plan, then you can use their translation management module.

WPML还提供了更好的方法来管理在您的网站上担任翻译的用户。 如果您购买了他们的多语言CMS计划,则可以使用他们的翻译管理模块。

Translation management module allows you to add users as translators regardless of what role they have on your WordPress site. You can even add subscribers as translators.

转换管理模块允许您将用户添加为翻译人员,无论他们在WordPress网站上扮演什么角色。 您甚至可以将订户添加为翻译器。

wordpress 多语言切换_python_09

Instead of editing posts, these translators will be able to add translations directly in WPML.

这些翻译者无需编辑帖子,而可以直接在WPML中添加翻译。

(Adding Translations for Categories and Tags)

WPML allows you to easily translate categories and tags, or any other custom taxonomies that you may be using.

WPML使您可以轻松翻译类别和标签 ,或您可能正在使用的任何其他自定义分类法 。

Visit WPML » Taxonomy Translation and load the custom taxonomies you want to translate.

请访问WPML»分类法翻译,并加载要翻译的自定义分类法。

For example: in this screenshot we selected categories, and it displayed all categories from our example site.

例如:在此屏幕截图中,我们选择了类别,并且显示了示例站点中的所有类别。

wordpress 多语言切换_python_10

Click on the add button next to the taxonomy term to add the translation.

单击分类术语旁边的添加按钮以添加翻译。

(Translating Navigation Menus)

WordPress comes with a robust navigation menu system. WPML allows you to translate it just like you would translate posts or taxonomies.

WordPress带有强大的导航菜单系统。 WPML允许您翻译它,就像翻译帖子或分类法一样。

Visit Appearance » Menus page on your site. If you have more than one menus, then select the menu you want to translate.

访问网站上的外观»菜单页面。 如果您有多个菜单,请选择要翻译的菜单。

In the right hand column, you will see your menu with links to translate into other languages enabled on your site.

在右侧栏中,您将看到菜单,其中包含可转换为网站上启用的其他语言的链接。

wordpress 多语言切换_大数据_11

Clicking on a language will create a new menu for that language. You will need to add the same menu items as in your primary language menu.

单击一种语言将为该语言创建一个新菜单。 您将需要添加与主要语言菜单相同的菜单项。

wordpress 多语言切换_大数据_12

If you have your posts and pages in navigation menus, then you will first need to translate them. After that you can add them from the tabs on the left in edit menu screens.

如果您的帖子和页面位于导航菜单中,则首先需要翻译它们。 之后,您可以从编辑菜单屏幕左侧的选项卡中添加它们。

Don’t forget to click on the save button to save your menu.

不要忘记单击保存按钮来保存菜单。

(Translating Themes, Plugins, & Other Text with WPML)

WPML multilingual CMS allows you to choose between official translations of themes and plugins or use its own string translator.

WPML多语言CMS允许您在主题和插件的官方翻译之间进行选择,或使用其自己的字符串翻译器。

Go to WPML » Themes and plugins localization page.

转到WPML»主题和插件本地化页面。

wordpress 多语言切换_wordpress_13

By default, you will see ‘Don’t use String Translation to translate the theme and plugins’ checked. Below it, you will see another checkbox to automatically load the theme’s .mo file using ‘load_theme_textdomain’.

默认情况下,您将看到“不使用字符串翻译来翻译主题和插件”复选框。 在它下面,您将看到另一个复选框,该复选框使用'load_theme_textdomain'自动加载主题的.mo文件。

You can check this box to see if there are any translation files available for your theme. This works only with themes downloaded from the WordPress.org theme directory.

您可以选中此框以查看是否有适用于您主题的翻译文件。 这仅适用于从WordPress.org主题目录下载的主题。

This setting doesn’t work very well for most websites. Not all WordPress themes and plugins have translations available. In some cases the translations are not good or incomplete.

此设置不适用于大多数网站。 并非所有WordPress主题和插件都提供翻译。 在某些情况下,翻译效果不佳或不完整。

We recommend using WPML’s String Translation module to properly translate your theme and plugins for your own site.

我们建议使用WPML的字符串翻译模块为您自己的网站正确翻译主题和插件。

This module will also allow you to translate custom fields, widgets, and other translatable strings generated by WordPress.

该模块还将允许您翻译WordPress生成的自定义字段 ,小部件和其他可翻译字符串。

We hope this article helped you learn how to create a WordPress multilingual site with WPML. You may also want to see our list of 40 useful tools to manage and grow your WordPress blog.

我们希望本文能帮助您学习如何使用WPML创建WordPress多语言站点。 您可能还想查看我们的40种有用工具的列表, 这些工具可以管理和发展WordPress博客 。


wpml cms