Skip to content
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

Binding settings not translated in Main UI #2641

Closed
lolodomo opened this issue Jul 4, 2024 · 4 comments · Fixed by openhab/openhab-core#4305
Closed

Binding settings not translated in Main UI #2641

lolodomo opened this issue Jul 4, 2024 · 4 comments · Fixed by openhab/openhab-core#4305
Labels
ohc bug A problem or unintended behavior of openHAB Core

Comments

@lolodomo
Copy link
Contributor

lolodomo commented Jul 4, 2024

The problem

Main UI presents untranslated label and description for binding settings while the translation is present in the properties file.

It concerns certain bindings like netatmo or sonos for example.

image

It is ok for addons like openhabcloud or voiceRSS.

image

Expected behavior

Main UI should consider existing translations for binding settings.

Additional information

I am asking myself if the problem would be when the addon.xml file contains config-description tag (and so all config settings declared in the addon.xml file) instead of a config-description-ref tag (config settings declared in a separate config.xml file) ?

Or maybe the translations are considered for voice and io addons but not binding addons ?

@lolodomo lolodomo added bug Something isn't working main ui Main UI labels Jul 4, 2024
@lolodomo
Copy link
Contributor Author

lolodomo commented Jul 7, 2024

I can see that Main UI is requesting /rest/config-descriptions/binding:netatmo to retrieve the binding parameters and the response is not localized. So the problem is in core framework.

@wborn @jlaur : maybe there is a mismatch between "binding" and "addon" ? In our properties files, the entries are:

addon.config.netatmo.readFriends.label = Access Guests
addon.config.netatmo.readFriends.description = For Weather Stations: A friend gave you access to their Netatmo Weather Station.

@florian-h05
Copy link
Contributor

So the problem is in core framework.

Exactly - Main UI only displays what it gets from the REST API.

@florian-h05 florian-h05 added ohc bug A problem or unintended behavior of openHAB Core and removed main ui Main UI bug Something isn't working labels Jul 9, 2024
@lolodomo
Copy link
Contributor Author

As I suspected, the core framework is inferring a key starting by "binding" and not "addon".
https://github.com/openhab/openhab-core/blob/918b4faa3b3254a993774147f798e8bc59580bf6/bundles/org.openhab.core.config.core/src/main/java/org/openhab/core/config/core/internal/i18n/ConfigDescriptionI18nUtil.java#L94

I really do not know why we used "addon" in all bindings properties.

To avoid changing all bindings, I will propose a fix in the inferKey method to use "binding" instead of "addon".
Already tested and working.

lolodomo added a commit to lolodomo/openhab-core that referenced this issue Jul 10, 2024
Fix openhab/openhab-webui#2641

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
lolodomo added a commit to lolodomo/openhab-core that referenced this issue Jul 10, 2024
lolodomo added a commit to lolodomo/openhab-core that referenced this issue Jul 10, 2024
lolodomo added a commit to lolodomo/openhab-core that referenced this issue Jul 10, 2024
…parameters

Fix openhab/openhab-webui#2641

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
lolodomo added a commit to lolodomo/openhab-core that referenced this issue Jul 15, 2024
Fix openhab/openhab-webui#2641

The i18n key for add-on configuration parameter should now start with "addon.config.".
To maintain compatibility with thousands of existing translations, an alternative i18n key starting with "<type>.config" is accepted when the add-on type is either io, persistence, voice or ui.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>

u#
lolodomo added a commit to lolodomo/openhab-core that referenced this issue Jul 15, 2024
Fix openhab/openhab-webui#2641

The i18n key for add-on configuration parameter should now start with "addon.config.".
To maintain compatibility with thousands of existing translations, an alternative i18n key starting with "<type>.config" is accepted when the add-on type is either io, persistence, voice or ui.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
lolodomo added a commit to lolodomo/openhab-core that referenced this issue Jul 15, 2024
Fix openhab/openhab-webui#2641

The i18n key for add-on configuration parameter should now start with addon.config.<param>.
To maintain compatibility with hundreds of existing translations, an alternative key starting with <type>.config.<param> is also accepted when the add-on type is either io, persistence, voice or ui.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
lolodomo added a commit to lolodomo/openhab-core that referenced this issue Jul 15, 2024
Fix openhab/openhab-webui#2641

The i18n key for add-on configuration parameter should now start with addon.config.<param>.
To maintain compatibility with hundreds of existing translations, an alternative key starting with <type>.config.<param> is still accepted when the add-on type is either io, persistence, voice or ui.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
lolodomo added a commit to lolodomo/openhab-core that referenced this issue Jul 15, 2024
Fix openhab/openhab-webui#2641

The i18n key for add-on configuration parameter should now start with addon.config.<param>.
To maintain compatibility with hundreds of existing translations, an alternative key starting with <type>.config.<param> is still accepted for an add-on parameter

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
J-N-K pushed a commit to openhab/openhab-core that referenced this issue Aug 4, 2024
…key (#4305)

Fix openhab/openhab-webui#2641

The i18n key for add-on configuration parameter should now start with addon.config.<param>.
To maintain compatibility with hundreds of existing translations, an alternative key starting with <type>.config.<param> is still accepted for an add-on parameter

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@lolodomo
Copy link
Contributor Author

lolodomo commented Aug 4, 2024

Closed by openhab/openhab-core#4305

@lolodomo lolodomo closed this as completed Aug 4, 2024
kaikreuzer pushed a commit to kaikreuzer/openhab-core that referenced this issue Aug 5, 2024
…key (openhab#4305)

Fix openhab/openhab-webui#2641

The i18n key for add-on configuration parameter should now start with addon.config.<param>.
To maintain compatibility with hundreds of existing translations, an alternative key starting with <type>.config.<param> is still accepted for an add-on parameter

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
wborn pushed a commit to openhab/openhab-core that referenced this issue Sep 7, 2024
…key (#4305)

Fix openhab/openhab-webui#2641

The i18n key for add-on configuration parameter should now start with addon.config.<param>.
To maintain compatibility with hundreds of existing translations, an alternative key starting with <type>.config.<param> is still accepted for an add-on parameter

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ohc bug A problem or unintended behavior of openHAB Core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants