问题
I am looking for an editor/comparator for i18n property files that would help me keep different language files in sync.
Basically, something that would compare a bunch a of property files and show which keys are not present in a particular language.
a property would look something like
component.titlepage.title = hello world
A simple diff is not possible since the right-hand-side will be different from a language to another.
Our current infrastructure:
- Java application
- Built using maven2
- Different i18n property files for different components of the system. (1 property file per language per component)
回答1:
The Checkstyle tool, which I typically run as part of every continuous integration build which is done after every check-in to the main branch, will tell you if any given set of properties files has an inconsistent set of properties. When I first started using Checkstyle, I indeed found that a few of my properties files were missing a small number of properties.
This won't help on the editor end, but it will help you efficiently identify any gaps.
回答2:
If you are using Eclipse, I find the ResourceBundle Editor plugin very handy. You can edit several properties files at the same time and you have warnings when a key is missing in one of the files.
回答3:
There are also a number of web applications that allow you to do that (along with many other activities). To name a few:
- Amanuens (disclaimer: my company builds this product)
- Transifex
- Get Localization
来源:https://stackoverflow.com/questions/907098/keeping-i18n-resources-synced