If a property of type ResKey is defined in a declarative form, an input field is displayed by default in which the ResKey format can be entered.
Application
Annotate the property of the declarative form to be able to directly enter the translations:
#!java @ItemDisplay(ItemDisplayType.MONOMORPHIC) @PropertyEditor(InternationalizationEditor.class) ResKey getMyProperty();
After the editing process, the property contains a literal ResKey (which stores translations in itself) as its value.
The InternationalizedUtil.storeI18N(ConfigurationItem) utility can be used to replace all literal `ResKey`s contained in the given item with "real" `ResKey`s and to transfer the translations from the literal into the translations of the applications. If the literal does not contain a key, a new key is generated.
Code migration
Implementations of Editor(com.top_logic.layout.form.values.edit.editor.Editor.createUI(EditorFactory, FormContainer, ValueModel)) must call EditorFactoryeditorFactory.processControlProviderAnnotation(valueModel.getProperty(), field); for the field on which an annotated ControlProvider should act.
Test
- New properties reskey-primitive, reskey-multiline-primitive and reskey-html-primitive in tl-demo "Declarative forms".