One of the most powerful features of WordPress is its ability to allow users to blog or manage content in their language of choice. If you have been using WordPress for a while (or just starting) and want to change the language for your admin dashboard, here are a few easy steps.
WordPress(下面我简称wp)的强大之一便是不同的用户可以根据自己语言的爱好来建博客管理文章。如果你用了一段时间想更换后台的显示语言的话,那么下面我就介绍几种方法。
Download the language files
下载语言文件.
You can get the language files you need from the WordPress in Your Languageweb page. The file will have a name such as in the following example: fr_FR.mo.
你需要在官网的wordpress语言包去下载语言包,这些文件就类似fr_FR.mo这样的。
- The first two small characters (‘fr’ for French) refer to the the ISO-639 language code. This is followed by the ISO-3166 country code (_FR for France in the example). So, the French .mo file would be called fr_FR.mo.
前面的fr字母是法语的意思,指的是国际标准化组织ISO639语言编码标准ISO-639。后来有ISO-3166编码(_FR是法文),所以说法语的文件对应的是fr_FR.mo
Copy Language files to your WordPress Installation
把语言文件复制到wp的安装目录
. Once you have downloaded the correct /mo file to your computer, copy it to your server in the directory ‘wp-content/languages’. You will probably need to create the ‘languages’ directory if you installed WordPress in English.
当你下载了语言包之后就把他们复制到站点的‘wp-content/languages’目录里面去,不过要是你开始就是安装的英语版的话languages可能需要手动新建。
Modify the wp-config.php file.
修改配置文件wp-config.php
In the root directory of your WordPress installation is a file named ‘wp-config.php’. This file includes all of the setting to allow you to connect to the database and manage a few other items. Download the file and open it up in your Text Editor application.
在wp站点的根目录下面找到文件wp-config.php,这个文件主要是用于wp站点的一些基本配置和管理其他项的,把它下载下来然后用编辑器(尽量不要用记事本打开,推荐使用notepad++)进行修改。
Edit the language line
修改语言配置
. Inside the ‘wp-config.php’ file, you will see the following lines:
在wp-config.php文件里面你可以找到下面的这段代码:
define ('WPLANG', );
- You will need to change this to use the file you just copied to your server. If using the example for French above, you would edit the like to look like the following:
这里你需要换成你刚下载的对应语言配置参数,按照上面的例子换成法语的话,就改这么写:
- You will need to change this to use the file you just copied to your server. If using the example for French above, you would edit the like to look like the following:
define ('WPLANG', 'fr_FR');
ps:这个参数要是你不知道怎么填写的话,打开上面的地址,每栏都会有注释的,我就列举一些吧。阿塞拜疆语的:azb、南非的公用荷兰语:af、阿尔巴尼亚语:sq_AL、阿拉伯语:ar、中文:zh_CN、港语:zh_HK、台灣正體:zh_TW、荷兰语:nl_NL
Visit your Admin Dashboard with your web browser
访问wp站点后台
. Your blog should now be displayed in the language you desired.
现在后台就会显示你想要的语言了
Alternative and more simple:
最简单最直接的方法就是
use wordpress language plugin
使用wp语言切换插件,ps:个人推荐这个WordPress Language
原文:How to Change the Default Language in WordPress