开发者

recommendation when working with xml language files

开发者 https://www.devze.com 2023-03-07 03:56 出处:网络
Simple question: When you are working with a GUI and use XML files to hold dictionaries for different languages. What is more efficient

Simple question:

When you are working with a GUI and use XML files to hold dictionaries for different languages. What is more efficient

  1. create one file and always work on that and then fill up other files after you know what needs to be translated or
  2. make them all at the same time?

The benefits of using one file in the beginning is of course that you will have the same structure in the other files without any refactoring.

Sample

English

<root>
<button_save>Save</button_save>
</root>

Swedish

<root>
<button_save>Spara</button_save>
</root>

Follow up question: Are there any nice plugins to Eclipse that actuelly can help with language files? Perhaps it could take in the selected language files and always add the fields to all the files whne y开发者_开发知识库ou create new?


One file per language (with correct file naming convention) is definitely what I would suggest. In that case you could easily add new languages in the future.
Also, fixing Localization defects would be easier - let us assume that several people are fixing such issues (i.e. after linguistic review) at the same time, but each people is working on a different language. With one file per language there won't be any problem, but if you keep everything in one file (multiple languages in one file model), there would be a lot of problems, requiring at best a lot of merging. This is error prone situation.

When you are asking about Eclipse, the first thing that comes to my mind is Java. If you are using Java, do you have any reason not to use standard properties files in that case?
There are plugins that make Java development easier, for example one of the most popular is JBoss Tools (which contain properties files editor). For XML files I don't know of any...

0

精彩评论

暂无评论...
验证码 换一张
取 消