论坛首页 Java企业应用论坛

I18N的使用

浏览 1312 次
锁定老帖子 主题:I18N的使用
该帖已经被评为隐藏帖
作者 正文
   发表时间:2009-02-15  
1、了解缺省Locale是由操作系统决定的

2、Locale是由语言和国家代码组成

3、国际化资源文件是由baseName+Locale组成的,如:MessagesBundle_zh_CN.properties
baseName是任意的合法文件名

4、native2ascii.exe命令的位置和用法
* 位置:JAVA_HOME/bin/
* native2ascii o.properties MessagesBundle_zh_CN.properties
如何将中文的国际化资源文件o.properties编译为Unicode编码的资源文件?
答 (a)编写一个中文的国际化资源文件o.properties
   (b) 将命令提示符转到目录cd C:\workspace\I18n_test\src下;
   (c) 注意:确保本地path含有C:\Program Files\Java\jdk1.5.0_17\bin;
        C:\workspace\I18n_test\path
    PATH=C:\Program Files\Java\jdk1.5.0_17\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Diskeeper Corporation\Diskeeper\;C:\Program
   (d) 将本地编码的国际化资源文件o.properties转化并生成一个为Unicode编码的国际化资源文件MessagesBundle_zh_CN.properties;
       C:\workspace\I18n_test\src>native2ascii.exe o.properties MessagesBundle_zh_CN.properties
       注意:操作系统语言设置必须是中文,才能将其转换为中文对应的Unicode编码
   
   
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics