Localized entries for "add-on settings"
lolodomo opened this issue · comments
The problem
List of add-ons are not localized in Main UI:
Your suggestion
Each add-on has a localized label (and description).
The entries displayed when building this list should provide the localized label.
As an example, I am expecting "Synthèse vocale VoiceRSS" in French rather than "VoiceRss Text-to-Speech".
I guess the API is currently called without providing the expected locale.
Might be also an API issue.
When run in dev env (Eclipse), I can see the French translation, that is "Extension Netatmo".
In normal run, the UI displays the untranslated label.
When run inside Eclipse, I can see that the addons REST API returns two entries for the netatmo binding, both with proper label and description translated, one with uid jar:binding-netatmo and one with uid eclipse:binding-netatmo.
When run on my RPI, the same API returns only one object with uid binding-netatmo and untranslated label and description.
on the RPI, the object is like that:
{
"uid": "binding-netatmo",
"id": "netatmo",
"label": "Netatmo Binding",
"version": "4.2.0",
"compatible": true,
"contentType": "application/vnd.openhab.feature;type=karaf",
"link": "https://www.openhab.org/addons/bindings/netatmo/",
"author": "openHAB",
"verifiedAuthor": true,
"installed": true,
"type": "binding",
"configDescriptionURI": "binding:netatmo",
"keywords": "",
"countries": [],
"connection": "cloud",
"properties": {},
"loggerPackages": [
"org.openhab.binding.netatmo"
]
},
There is apparently a method isMasterAddonInfo
used to return or not the translated label and description:
https://github.com/openhab/openhab-core/blob/918b4faa3b3254a993774147f798e8bc59580bf6/bundles/org.openhab.core.karaf/src/main/java/org/openhab/core/karaf/internal/KarafAddonService.java#L137
There is also the class AddonInfoAddonsXmlProvider
reading the file runtime/etc/addons.xml file and building AddonInfo from this file with masterAddonInfo set to false:
https://github.com/openhab/openhab-core/blob/918b4faa3b3254a993774147f798e8bc59580bf6/bundles/org.openhab.core.addon/src/main/java/org/openhab/core/addon/internal/xml/AddonInfoAddonsXmlProvider.java#L98
The addons.xml file contains label and description in English.
I am not yet understanding the full logic.
Ok, the problem is very probably at this line:
https://github.com/openhab/openhab-core/blob/918b4faa3b3254a993774147f798e8bc59580bf6/bundles/org.openhab.core.addon/src/main/java/org/openhab/core/addon/AddonInfoRegistry.java#L109
I will prepare and test a fix.
Fixed by openhab/openhab-core#4309