zabbix是一个多语言监控系统,界面显示由对应的语言下的frontend.mo控制。当前对中文的翻译不彻底,以下图php
若是咱们须要本身优化,将此翻译成中文,那么你须要修改zh_CN下的frontend.po,而后make_mo.sh建立frontend.mo。下面以vim
为例,介绍zabbix界面的汉化过程。bash
[root@zabbix ~]# find / -name frontend.po /root/cn_LC_MESSAGES/frontend.po /usr/share/zabbix/locale/bg/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/cs/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/de/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/el/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/en_US/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/es/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/fa/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/fi/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/fr/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/hu/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/id/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/it/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/ja/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/ko/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/lt/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/lv/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/nl/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/pl/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/pt_BR/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/pt_PT/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/ro/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/ru/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/sk/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/sv/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/tr/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/uk/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/vi/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/zh_CN/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/zh_TW/LC_MESSAGES/frontend.po /usr/share/zabbix/locale/ka/LC_MESSAGES/frontend.po
[root@zabbix LC_MESSAGES]# vim frontend.po
将frontend
#: include/blocks.inc.php:486 msgid "Number of items (enabled/disabled/not supported)" msgstr ""
修改成svn
#: include/blocks.inc.php:486 msgid "Number of items (enabled/disabled/not supported)" msgstr "监控项(启用/禁用/不支持)"
/usr/share/zabbix/locale/make_mo.sh
zabbix提供的脚本 /usr/share/zabbix/locale/make_mo.sh 实现语言文件po到mo的转换,其实/usr/share/zabbix/locale/make_mo.sh调用的就是gettext中的gettext。工具
[root@zabbix locale]# cat /usr/share/zabbix/locale/make_mo.sh #!/bin/bash while read pofile; do msgfmt --use-fuzzy -c -o ${pofile%po}mo $pofile done < <(find $(dirname $0) -type f ! -wholename '*/.svn*' -name '*.po')
gettext工具下载地址:http://gnuwin32.sourceforge.net/packages/gettext.htm优化
gettext包中包含了msgunfmt.exe、msgfmt.exe 等文件,能够实现语言文件po和mo的互相转换spa
根据po生成mo.net
从新生成mo文件
cd C:\Software\GetText\bin
msgfmt.exe C:\Users\xqzt\Desktop\当前\frontend.po -o C:\Users\xqzt\Desktop\当前\frontend.mo
根据mo生成po翻译
cd C:\Software\GetText\bin
msgunfmt.exe C:\Users\xqzt\Desktop\frontend.mo -o C:\Users\xqzt\Desktop\frontend.po