API Annotations, LabelKey?

Is there a way to use a an i18n key for an extension point's config field label?

I was expecting to find an @LabelKey annotation available, but that doesn't exist.

I've tried using the @TitleKey, but that doesn't seem to do anything for the ExtensionPointResourceForm UI. My category + description keys are working as expected.

data class SnmpNetworkConfig(
    @FormCategoryKey("Snmp.config.Network")
    @TitleKey("Snmp.config.Network.Hostname.Name")
    @DescriptionKey("Snmp.config.Network.Hostname.Description")
    @FormField(FormFieldType.TEXT)
    @Required
    val hostname: String,

    @FormCategoryKey("Snmp.config.Network")
    @TitleKey("Snmp.config.Network.Port.Name")
    @DescriptionKey("Snmp.config.Network.Port.Description")
    @DefaultValue("161")
    @FormField(FormFieldType.NUMBER)
    @Required
    val port: Int,
)

P.S. This is my actual code :upside_down_face:

In my drivers, I had to use @Label(), and had to include the asterisk marker for required fields explicitly. No such thing as @LabelKey(), yet.

Like so:

    public record Behavior(
            @FormCategoryKey("modbus.Category.Behavior")
            @FormField(FormFieldType.NUMBER)
            @Label("Concurrent Requests *")
            @Required
            @Maximum("500")
            @Minimum("1")
            @DefaultValue("1")
            @DescriptionKey("modbus.MaxOutstanding.Desc")
            int maxOutstanding,

            @FormCategoryKey("modbus.Category.Behavior")
            @FormField(FormFieldType.NUMBER)
            @Label("Execution Timeout *")
            @Required
            @Maximum("60000")
            @Minimum("100")
            @DefaultValue("1000")
            @DescriptionKey("modbus.ExecTimeout.Desc")
            int execTimeout,

Also actual code...

1 Like

Yeah unfortunately we've taken a step backwards in functionality here. I'm not sure what the plan or timeline is to make improvements, but we're definitely aware.

2 Likes