zpanel汉化非常的不容易,折腾了很多天才搞定,网上的汉化教程多是早期版本的教程.搞起来也不是那么的顺手,汉化主要分为三个部分,分别是数据库、模板和系统文件的设置,缺一都不可.其实系统里面自带的也有ZXTS模块,这个模块可以让你安装很多的语言包,但是实际测试的话安装总是卡到60%多就不能完全进行汉化了.还有可以用官方的SQL语句进行导入,但是这条路也是不通的,导入后切换到中文就500错误了.我的中文SQL里面包含的有WHMCS的插件汉化,程序不是过于严谨,可以自行的删除,下面开始介绍汉化的步骤.

1.先把数据库连接字符串改成UTF-8的方便中文

找到 /etc/zpanel/panel/inc/dbc.inc.php把里面的“$zdbh = new db_driver(“mysql:host=$host;dbname=$dbname”, $user, $pass);”

整句话替换成“$zdbh = new db_driver(“mysql:host=$host;dbname=$dbname”, $user, $pass, array(PDO::MYSQL_ATTR_INIT_COMMAND => “SET NAMES ‘utf8′”));”

2.用root权限登陆phpmyadmin执行以下语句:把sql数据库也修改为utf-8编码的.

ALTER TABLE `x_translations` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_accounts` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_aliases` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_bandwidth` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_cronjobs` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_distlists` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_distlistusers` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_dns` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_faqs` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_forwarders` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_ftpaccounts` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_groups` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_htaccess` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_logs` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_mailboxes` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_modcats` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_modules` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_mysql_databases` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_mysql_dbmap` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_mysql_users` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_packages` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_permissions` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_profiles` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_quotas` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_settings` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `x_vhosts` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

删除原数据库里面的_core里面的x_translations这个,然后把我已经汉化的x_translations导入到里面,记得要下载下来导入,不要在浏览器里面操作.

最后一步把已经搞定的zpanel里面的模板替换掉,直接原路径替换掉就可以了,如果不替换模板的话,可能左边的汉化的不是那么完美.

zpanel的web安装路径是:/etc/zpanel/panel。这里我提供完整的包里面包含了中文phpmyadmin,如果需要使用的话只要替换掉模板文件就可以了。

相关文件下载:x_translations本地下载 x_translations ME网盘下载 x_translations 百度网盘下载 中文整包本地下载 中文整包ME网盘下载 中文整包百度网盘下载