开发者

Best practice for keeping track of i18n labels that need translating in Grails?

开发者 https://www.devze.com 2023-04-13 06:14 出处:网络
I\'m working on a Grails project that is internationalized (using the .properties resource bundles), and at the end of each release, we send a list of all the i18n messages that need to be translated.

I'm working on a Grails project that is internationalized (using the .properties resource bundles), and at the end of each release, we send a list of all the i18n messages that need to be translated. The problem is, there is no way to know which ones need updating/which ones are missing without manually tagging it (ie adding some 'magic word' at the end of each key). This seems very hacky and error prone.

What is common 开发者_C百科practice for keeping track of uninternationalized i18n labels?

Thanks.


Missing labels can automatically be detected by the ResouceCheck ant task. In particular, with the cross bundle check, it can inform you if a label is missing from any the properties for any locale.

For updated labels, I generally store the version number of the messages.properties that was last used as translation source in a header comment in each messages_xx.properties. Then a diff between the current messages.properties and the translation source version will show the properties that have changed and need to be retranslated.

0

精彩评论

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

关注公众号