Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a developer I would like to group text key entries (either by comment or group element) #14

Open
danielkellenbergernca opened this issue Aug 17, 2015 · 2 comments

Comments

@danielkellenbergernca
Copy link

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:

  1. 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
  2. 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

@marcelstoer
Copy link
Collaborator

Thanks for a nice and complete description.

+1 for retaining XML comments, that's a pretty basic feature.
-1 for using XML comments to group keys in large Trema files as a way of organizing them. Split it into individual files instead. Spring for example supports applications with multiple message source base names out-of-the-box.
-1 for grouping, let alone nested, with extra XML elements as that has all kinds of nasty implications. CTRL + F in your favorite non-Trema-Eclipse XML editor searching for the key "foo.bar.baz.key" is just the most obvious one.

@danielkellenbergernca
Copy link
Author

We already have 5(!) different trema files. So we know already how to split up files and having multiple message source base names. Anyway, thanks for the hint.
If groups are supported, the prefix should be optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants