A literal resource key #("Hallo"@de, "Hello"@en) contains so far only its translations (but no key - it is never looked up in the translation tables).
However, if you want to use a literal resource key to store a translation entered at the GUI in the translation tables, it can be useful if you can also encode the key in the literal under which the translations entered in this way are to be stored later (the key whose existing translations are to be overwritten with the new translations).
Usage
#!java Builder builder = ResKey.builder("my.key"); builder.add(en(), "foo"); builder.add(de(), "bar"); ResKey key = builder.build();
Then key.getKey() returns the value my.key.
Also, a better XML format for resource keys is needed if you want to use literal keys to export (with) the current translations:
Instead of <a text='#("foo"@en, "bar"@de)'/> better:
#!xml <a> <text> <en>foo</en> <en>bar</de> </text> </a>.
This format can also store a target key with:
#!xml <a> <text key="my.key"> <en>foo</en> <en>bar</en> </text> </a>
Test
- test.com.top_logic.basic.util.TestResKeyXMLBinding