Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
We advertise the SCR annotations with "single source development" = everything is in a single java source file, no need to edit any other file (like the DS xml descriptor). However as soon as you use metatype information this is not necessarily true, especially if you want to put the real values in a separate metatype.properties file.
This somehow breaks the ease of use promise and requires to keep the source code and the metatype properties in sync.
We could easily get away with this by always creating a metatype.properties file when information like label or description is inlined, e.g.
@Property(label = "Velocity", description="Set the velocity", name="velocity") will
create a metatype.properties file with
PID.velocity.name = Velocity
PID.velocity.description = Set the velocity
and a metatype XML with
<AD id="velocity" type="String" default="" name="%PID.velocity.name description="%PID.velocity.description"/>
This would allow to add translations even if the information was inlined in the source code.
We could add a switch whether this should be enabled or not, default set to true. I think we need this switch just for the (rare?) case where within the same bundles some metatype is inlined while other metatype info is within a metatype.properties. - we could even handle this by merging a potentially existing props file with the generated.