-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Label/description handling @text strings when building a channel type, a channel or a discovery result #2546
Comments
For discovery results, we already have a search in property files so maybe it is just a bug if @text is not supported. Unfortunately I don't find immediately the class implementing the current behavior. |
Found for discovery Line 252 in 79edf2b
So it should work in theory with @text. Edit: the problem is when a binding uses DiscoveryResultBuilder.create rather than ThingDiscovered which is the case for mDNS or UPNP discovery for example. |
IIRC discovery already supports translations. And I bet it was implemented by yourself back in the days (see eclipse-archived/smarthome#4177). I am not sure about channel types. If a binding provides custom channel types there must be a registry implementation too. If so it should be responsible for correct localization. Same for channel group types. Currently I do not have an idea how to handle channels. At best they should always use an already available channel type and inherit label/description/options and so on from it. I am aware that everything can be overwritten. Same for channel groups. |
For discovery, using @text is not working, I will have to investigate a little more why and in what case exactly it fails. |
It probably fails because MDNSDiscoveryService is a core service so properties are not searched in the binding bundle but in one core bundle. |
Related to openhab#2546 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* mDNS / UPnP discovery internationalization Related to #2546 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Discovery is now OK. Remains the creation of dynamic channel types and channels. For channel type, I have the feeling I could use ChannelTypeI18nLocalizationService. |
@lolodomo Are you still working on this? |
This is on my TODO list, but not very high to be honest. |
For channel types, I can confirm that ChannelTypeI18nLocalizationService .createLocalizedChannelType is the solution to localize channel types built dynamically. |
* mDNS / UPnP discovery internationalization Related to openhab#2546 Signed-off-by: Laurent Garnier <lg.hc@free.fr> GitOrigin-RevId: 089b9d2
When building a channel type, a channel or a discovery result, it would be interesting to be able to pass a @text string referencing a property file for the label and for the description.
This will help binding internationalization.
@cweitkamp : as you are our specialist for i18n, do you thing this is doable and easy ?
The text was updated successfully, but these errors were encountered: