在IDEA中编辑struts国际化properties文件


在IDEA中编辑struts国际化properties文件

如果手工创建的web工程,struts的i18n属性文件,可以使用native2ascii工具转换(记得命令行的第二个文件名是要保存的文件名,如果不写,不会自动修改原文件的)。

如果是Eclipse,应该可以以图形化方式编辑。

如果是IDEA, 可以用如下方法编辑:

  • 更改系统配置:Preferences–>Editor–>FileCodings,选中“Transparent native-to-ascii conversion”。
  • 至少创建2个property文件,如:messenUS.properties和messzhCN.properties,IDEA会自动形成一个Resource Bundle。
  • 可以以图形方式进行编辑,中英文对比,很方便,填写的中文会自动转换成\u5f55这样的内容存储。
  • 也可以直接编辑中文文件,中文也会自动转换。

参考资料:
https://www.jetbrains.com/idea/help/configuring-encoding-for-properties-files.html
https://www.jetbrains.com/idea/help/editing-resource-bundle.html

Author: galaxy

Created: 2015-07-02 Thu 15:55

Emacs 24.4.1 (Org mode 8.2.10)

Validate

 

posted @ 2015-07-02 15:57  galaxy-gao  阅读(6480)  评论(0编辑  收藏  举报