By admin | January 8, 2008 - 12:59 pm - Posted in 技术::Tech

语言包使用方法:

1、将压缩包中的”zh_CN.mo”文件上传到站点以下目录中:

“\wp-content\languages”

如果此目录不存在,请自行建立。

2、对站点根目录中的“wp-config.php”进行修改:

define (’WPLANG’, “);

修改为:

define (’WPLANG’, ‘zh_CN’);

If you go to your option and find your language still can not show up properly, at the most case is that your host is using 64 bit CPU and wordpress’s gettext file has not been updated according to this. Here is the code you have to accommodate.

wp-includes/gettext.php line 106

  1. $this->enable_cache = $enable_cache;
  2. // $MAGIC1 = (int)0×950412de; //bug in PHP 5.0.2
  3. $MAGIC1 = (int) - 1794895138;
  4. // $MAGIC2 = (int)0xde120495; //bug
  5. $MAGIC2 = (int) - 569244523;
  6. // 64-bit fix
  7. $MAGIC3 = (int) 2500072158;
  8. $this->STREAM = $Reader;
  9. $magic = $this->readint();
  10. if ($magic == ($MAGIC1 & 0xFFFFFFFF) || $magic == ($MAGIC3 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
  11. $this->BYTEORDER = 0;
  12. } elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
  13. $this->BYTEORDER = 1;
  14. } else {
  15. $this->error = 1; // not MO file
  16. return false;
  17. }

Changed to the below code:

[source:php]
$this->enable_cache = $enable_cache;

// $MAGIC1 = (int)0×950412de; //bug in PHP 5
$MAGIC1 = (int) - 1794895138;
// $MAGIC2 = (int)0xde120495; //bug
$MAGIC2 = (int) - 569244523;
$MAGIC3 = (int) 2500072158; // STREAM = $Reader;
$magic = $this->readint();
if ($magic == $MAGIC1 || $magic == $MAGIC3) { // BYTEORDER = 0;
} elseif ($magic == $MAGIC2) {
$this->BYTEORDER = 1;
} else {
$this->error = 1; // not MO file
return false;
}
[/source]

This entry was posted on Tuesday, January 8th, 2008 at 12:59 pm and is filed under 技术::Tech. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

Preview: