保持 i18n 资源同步

我正在寻找 i18n 属性文件的编辑器/比较器,它可以帮助我保持不同语言文件的同步.

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.

一个属性看起来像

component.titlepage.title = hello world

简单的差异是不可能的,因为右侧会因一种语言而异.

A simple diff is not possible since the right-hand-side will be different from a language to another.

我们当前的基础设施:

  • Java 应用程序
  • 使用 maven2 构建
  • 系统不同组件的不同 i18n 属性文件.(每个组件每种语言 1 个属性文件)

推荐答案

Checkstyle 工具,我通常作为每个持续集成构建的一部分运行,该构建在每次签入主分支后完成,它将告诉您是否任何给定的属性文件集具有不一致的属性集.当我第一次开始使用 Checkstyle 时,我确实发现我的一些属性文件缺少少量属性.

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.

相关文章