openfire 插件web 页面显示国际化
来源:互联网 发布:制造业数据分析 2016 编辑:程序博客网 时间:2024/06/18 16:40
1、在插件的src下建一个i18n的文件夹。下面是 插件名_i18n_语言简写.properties的文件。需要的语言变量在 这些文件中配置
Plugin.xml 要国际化的地方 ,全部用 变量(变量名随意起,尽量规范)
<?xml version="1.0" encoding="utf-8"?><plugin> <!-- Main plugin class 这里是最重要滴,就是你的插件的全路径--> <class>com.maojd.test.MyPlugin</class> <!-- Plugin meta-data --> <name>${plugin.name}</name> <description>${plugin.description}</description> <author>maojd</author> <version>1.0.0.1</version> <date>24/11/2013</date> <url>http://localhost:9090/openfire/plugins.jsp</url> <minServerVersion>3.4.1</minServerVersion> <licenseType>gpl</licenseType> <adminconsole> <tab id="tab-server"> <sidebar id="sidebar-server-settings"> <item id="sample-service" name="${plugin.itemName}" url="myplugin-demo1.jsp" description="${plugin.ItemDescription}" /> </sidebar> </tab> </adminconsole></plugin>
myplugin_i18n_en.properties中:
plugin.name = MyPlugin i18n en
plugin.description = This is the my sample plugin. i18n en
plugin.itemName = sample plugin name
plugin.ItemDescription = Click is trigger sample plugin
myplugin_i18n_zh_CN.properties中:
plugin.name = MyPlugin i18n zh_CN \u4E2D\u6587
plugin.description = This is the my sample plugin. i18n zh_CN \u4E2D\u6587
plugin.itemName = itemName\u540D\u5B57 \u7B80\u5355\u63D2\u4EF6
plugin.ItemDescription = \u70B9\u51FB\u8FD9\u91CC\u8BD5\u8BD5 \u8C03\u8F6C
附上修改语言的方法:
打开:项目根目录/target/openfire/conf/openfire.xml
找到:<locale>zh_CN</locale>
把zh_CN换成 cn 则变成英文
插件jsp国际化
国际化文件的用法不变。还是在i18n下的国际化文件中 写 变量 = 相应的值
Jsp中国际化(实际上是JSTL国际化):
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
在需要国际化的地方:
格式:<fmt:message key="变量名"/>
代码eg:<title><fmt:message key="plugin.hello"/></title>
- openfire 插件web 页面显示国际化
- openfire 插件web 页面菜单栏定位
- web页面国际化---之js翻译插件
- openfire插件中国际化文件的使用
- Openfire 开发插件web UI
- java-web国际化开发基础和实现国际化显示的登入页面详解
- 国际化显示的登陆页面
- openfire 插件--readme.html页面乱码解决
- 给Openfire插件加上WEB访问功能
- openfire 插件web工程web-custom.xml配置文件说明
- openfire 插件
- openfire插件
- Openfire插件
- openfire 插件
- web国际化日期显示及数字格式
- web图片显示插件
- web页面显示时间
- Android_WebView显示Web页面
- C指针原理(29)-AT&T汇编
- jsp+servlet 实现登录功能
- iOS学习之UINavigationController详解与使用(一)添加UIBarButtonItem
- 电子相框遇到的问题
- Netty源代码阅读
- openfire 插件web 页面显示国际化
- 性格的自白
- delphi7IDE技巧
- FTPHelper-FTP帮助类,常用操作方法
- Qt 关闭窗口时循环依旧运行的解决办法
- 指标网页的载入光阴也会影响推行品质得分
- SGU133-Border (Sort)
- android 设备管理屏幕锁定实现方法
- struts2+Hibernate+Spring+zTree+异步加载