设为首页 收藏本站
查看: 1344|回复: 0

[经验分享] zabbix汉化

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-8-4 09:35:24 | 显示全部楼层 |阅读模式
  zabbix服务器端安装好后,发现都是英语,对大部分人来说需要汉化下,才容易被接受,一下就是汉化的步骤,具体如下:
1,修改locales.inc.php文件中的中文支持打开把flase改为true(zabbix默认的是关闭的,实际上是支持中文的)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
[iyunv@GJB-Monitor ~]# vi /data/php/include/locales.inc.php
<?php
/*
** Zabbix
** Copyright (C) 2001-2016 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
function init_mbstrings() {
        $res = true;
        $res &= extension_loaded('mbstring');
        if (version_compare(PHP_VERSION, '5.6', '<')) {
                ini_set('mbstring.internal_encoding', 'UTF-8');
                $res &= (ini_get('mbstring.internal_encoding') === 'UTF-8');
        }
        else {
                ini_set('default_charset', 'UTF-8');
                $res &= (ini_get('default_charset') === 'UTF-8');
        }
        ini_set('mbstring.detect_order', 'UTF-8, ISO-8859-1, JIS, SJIS');
        $res &= (ini_get('mbstring.detect_order') === 'UTF-8, ISO-8859-1, JIS, SJIS');
        return $res;
}
/**
* Returns a list of all used locales.
*
* Each locale has the following properties:
* - name       - the full name of the locale
* - display    - whether to display the locale in the frontend
*
* @return array    an array of locales with locale codes as keys and arrays as values
*/
function getLocales() {
        return [
                'en_GB' => ['name' => _('English (en_GB)'),     'display' => true],
                'en_US' => ['name' => _('English (en_US)'),     'display' => true],
                'bg_BG' => ['name' => _('Bulgarian (bg_BG)'),   'display' => false],
                'zh_CN' => ['name' => _('Chinese (zh_CN)'),     'display' => true],
                'zh_TW' => ['name' => _('Chinese (zh_TW)'),     'display' => false],
                'cs_CZ' => ['name' => _('Czech (cs_CZ)'),       'display' => true],
                'nl_NL' => ['name' => _('Dutch (nl_NL)'),       'display' => false],
                'fi_FI' => ['name' => _('Finnish (fi_FI)'),     'display' => false],
                'fr_FR' => ['name' => _('French (fr_FR)'),      'display' => true],
                'ka_GE' => ['name' => _('Georgian (ka_GE)'),    'display' => false],
                'de_DE' => ['name' => _('German (de_DE)'),      'display' => false],
                'el_GR' => ['name' => _('Greek (el_GR)'),       'display' => false],
                'hu_HU' => ['name' => _('Hungarian (hu_HU)'),   'display' => false],
                'id_ID' => ['name' => _('Indonesian (id_ID)'),  'display' => false],



2,在页面上进行设置:admin--user--language--chinese(zh_CN)

3,修改之后如果中文界面还出现乱码的话,解决方案为:
1,修改zabbix配置文件中的字体为微软雅黑字体修改配置文件include/defines.inc.php
1
2
3
[iyunv@GJB-Monitor ~]# vim /data/php/include/defines.inc.php
define('ZBX_FONT_NAME', 'DejaVuSans');
define('ZBX_GRAPH_FONT_NAME', 'DejaVuSans');



修改为:
1
2
define('ZBX_FONT_NAME', 'msyh');
define('ZBX_GRAPH_FONT_NAME', 'msyh');



2,在Windows系统下选择:控制面板\所有控制面板项\字体\微软雅黑-->右击复制--粘贴到相应的位置
3,把这两个文件拷贝到zabbix的web端的font目录下:/data/php/fonts
1
2
3
4
5
6
[iyunv@GJB-Monitor ~]# ll /data/php/fonts/
总用量 36264
-rw-r--r-- 1 zabbix zabbix   756072 8月   3 10:29 DejaVuSans.ttf
-rw-r--r-- 1 root   root   14602860 6月  11 2009 msyhbd.ttf
-rw-r--r-- 1 root   root   21767952 6月  11 2009 msyh.ttf
[iyunv@GJB-Monitor ~]#



在web端查看即为正常


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-252574-1-1.html 上篇帖子: 利用Zabbix API 创建主机 下篇帖子: zabbix-数据库移植
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表