In our project we have our trema file annotated with comments, in order to group it. For example:
<!--
COMMON KEYS
-->
<text key="common.language">
[...]
</text>
After update of any texts, all comments in the original trema file vanishes.
I see two general ways to support grouping:
- Support of comments by not exporting the XMLDatabase directly to an XML file, but merge it with the existing XML file or store the comments as a field in XMLTextNode
- Favorite solution: Instead of supporting comments, support grouping of text keys (maybe even supporting nested groups with key prefix). Example:
<group prefix="common">
<text key="language">
[...]
</text>
</group>
will export it as common.language. Example with nested groups:
<group prefix="foo.bar">
<group pref="baz">
<text key="key">
[...]
</text>
</group>
</group>
will export it as foo.bar.baz.key