在使用gxt的时候 发现默认使用的是English
这样的话应用开发起来不能够完全中文化
这样可是太不方便了哈
在gxt的官方网站中找到了提示:http://www.sencha.com/forum/showthread.php?40607-How-to-translate-Ext-GWT-s-messages/page6
只是改变一下配置文件就行了
在gxt的jar文件中已经包括了XMessage_zh.properties文件
故能够帮助我们实现中文化
下面把主要的内容粘贴下来:
- Create the messages file. You can translate from english language in com/extjs/gxt/ui/client/messages/XMessages.properties
- Save your file as "XMessages_<country code>.properties" e.g XMessages_id.properties
- Open gxt.jar with winzip or winrar or another program and goto
"com/extjs/gxt/ui/client/messages" folder and add your translation file
there
- That's it. Your translation is already included in gxt.jar file. --
In my case, I need to reconfigure my build path (I'm using eclipse and
it doesn't automatically detect the new translation file). I remove the
gxt.jar from the build path and re-include it in my project
- Now, add the locale to your gwt module xml (YourProject.gwt.xml) file like this:
<module>
<inherits name="com.google.gwt.user.User"/>
<inherits name="com.google.gwt.i18n.I18N"/>
<!-- Below is the line. Replace the "id" string to your country code (same as your XMessages_<country code>) file -->
<extend-property name="locale" values="id"/>
</module>
- Your translation (locale) is already included in your gwt module.
Now you must specify your locale to be loaded by the client side script
(html). Add this line to your html file like this:
<html>
<head>
<!-- Below is the line. Replace the "id" string to your country code (same as your XMessages_<country code>) file -->
<meta name="gwt:property" content="locale=id">
</head>
<body>
<!-- Load the GWT compiled module code -->
<script src="com.google.gwt.examples.i18n.ColorNameLookupExample.nocache.js " />
</body>
</html>
- You can also load the locale by setting from query string like:
http://www.example.org/myapp.html?locale=id
- Refresh your browser or recompile your project. Done. Your gxt is now in your language
分享到:
相关推荐
这个是官方的英文帮助,对大家开发有帮助。里面描述所有gxt 的类的用法
GXT 学习的好书, 帮助你尽快进入GXT.
GXT Cascade ComboBox Samples
gxt初学进阶教程,教你一步一步使用gxt,容易上手,例子很详细
浪曦原创]GXT系列+第1讲+GXT_GWT的安装.
这是GTA4里的源文件american.gxt
贡献一个GXT项目给大家,希望对大家有所帮助!
gwt 文件上传 gxt文件上传
gxt-api-2.2.1帮助文档 。
GXT 下拉树(Combo Tree)基本实现GXT 下拉树(Combo Tree)基本实现GXT 下拉树(Combo Tree)基本实现GXT 下拉树(Combo Tree)基本实现GXT 下拉树(Combo Tree)基本实现GXT 下拉树(Combo Tree)基本实现GXT 下拉树(Combo ...
extjs gwt gxt 学习资源 ajax技术
gxt-api-2.2.5 sdk doc 即ext-gwt api doc
GWT,GXT的JAR包以及源代码,需要的朋友可以下载。 谷歌推出的WebUI的JAVA的库。谢谢大家下载
一步一步教你新建GXT(EXT-GWT)项目
本资源是目前的最新版本(9/15/11) gxt的工具非常之少,在CSDN还有一个gxt-2.1.1(2/2/2010)链接就不提供了,大家根据需要选择下载。
GXT2.2.4 GXT2.2.4 GXT2.2.4GXT2.2.4 GXT2.2.4 GXT2.2.4GXT2.2.4 GXT2.2.4 GXT2.2.4GXT2.2.4 GXT2.2.4 GXT2.2.4GXT2.2.4 GXT2.2.4 GXT2.2.4 jar
gxt.jar
目前最适合gxt初学者学习的教程
gwt+gxt jar 包。。基于java语言编写前台界面,java语言最终会被编译成js。方便了不会js的java程序员编写前台
gwt gxt 开发的项目。花了三、四个星期才写完的。