ART 轻量级报表工具汉化


打开语言文件目录:cd /usr/local/java/tomcat/webapps/art/WEB-INF/i18n

[root@centos]# cd /usr/local/java/tomcat/webapps/art/WEB-INF/i18n
[root@centos]# i18n]# ll
总计 200
-rw-r--r-- 1 root root  5249 12-08 15:21 ArtMessages_es.properties
-rw-r--r-- 1 root root  5269 12-08 15:21 ArtMessages_fr.properties
-rw-r--r-- 1 root root  3898 12-08 15:21 ArtMessages_hu.properties
-rw-r--r-- 1 root root  3322 12-08 15:21 ArtMessages_it.properties
-rw-r--r-- 1 root root 55202 12-08 15:21 ArtMessages_lt.properties
-rw-r--r-- 1 root root 47072 12-08 15:21 ArtMessages.properties
-rw-r--r-- 1 root root  5258 12-08 15:21 ArtMessages_pt_BR.properties
-rw-r--r-- 1 root root 47518 12-08 15:21 ArtMessages_sw.properties
-rw-r--r-- 1 root root  2246 12-08 15:21 ArtMessages_zh_CN.properties
-rw-r--r-- 1 root root  2253 12-08 15:21 ArtMessages_zh_TW.properties
-rw-r--r-- 1 root root   512 12-08 15:21 languages.properties
[root@centos]# 

可以看到这些文件都是用于支持不同语言的配置脚本。其中语言的选用在文件  languages.properties 设置

[root@centos]# vi languages.properties

# list of languages to be displayed in the language drop down box
# format is <language code> = <language name>
# see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
# and https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_and_their_capitals_in_native_languages

en = English
#sw = Kiswahili
#fr = Fran\u00e7ais
#it = Italiano
#de = Deutsch
#lt = Lietuvi\u0173
#es = Espa\u00f1ol
#hu = Magyar
#pt_BR = Portugu\u00eas (Brasil)
zh_CN = \u7b80\u4f53\u4e2d\u6587
#zh_TW = \u7e41\u9ad4\u4e2d\u6587

将 zh_CN = \u7b80\u4f53\u4e2d\u6587 前面的“#” 去掉 ,保留英文和中文,其他注释。 后面的字符为 unicode 编码, “\u7b80\u4f53\u4e2d\u6587” 中文为 “简体中文” 。


修改完成后重启 tomcat 服务:

service tomcat stop
service tomcat start

退出 art 登录或重新登陆,可看到有选择 “ 简体中文” 语言



但是选择中文登录进来,还是有很多英文的!这时因为,汉化文件尚未汉化所有的英文。

在 目录 /usr/local/java/tomcat/webapps/art/WEB-INF/i18n 中,看到文件 ArtMessages_zh_CN.properties  ,这就是汉化文件。


怎么汉化呢?找一个文件测试一下。


该头部导航对应的 jsp 文件为:

vi /usr/local/java/tomcat/webapps/art/WEB-INF/jsp/header.jsp



找到这样的信息: header.link.reports 、header.link.jobs  ,这两个名词分别对应导航的 “Reports ”  和 “Jobs”  。编辑 ArtMessages_zh_CN.properties 添加以下汉化信息。

vi /usr/local/java/tomcat/webapps/art/WEB-INF/i18n/ArtMessages_zh_CN.properties


红框为新增加的汉化,将中文名称转unicode编码就行(中文转unicode工具很多)

保存后重启 tomcat 服务,重新登陆 art 。头部导航已汉化:



不过要是汉化所有,得花很长时间啊。所以,求共享,求开源  ^ ^……


后续:花了些时间,终于汉化完了,已上传到 github


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值