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

[mqtt.generic] There is not yet any default translation properties file. #12220

Closed
jimtng opened this issue Feb 6, 2022 · 6 comments · Fixed by #12328
Closed

[mqtt.generic] There is not yet any default translation properties file. #12220

jimtng opened this issue Feb 6, 2022 · 6 comments · Fixed by #12328

Comments

@jimtng
Copy link
Contributor

jimtng commented Feb 6, 2022

There is not yet any default translation properties file.

Originally posted by @lolodomo in #12167 (comment)

I tried creating the translations file for org.openhab.binding.mqtt.generic using this command:

$ mvn org.openhab.core.tools:i18n-maven-plugin:3.2.0:generate-default-translations -pl :org.openhab.binding.mqtt.generic

It created a file called mqtt.properties

Questions:

  1. Should the existing mqttbroker_de.properties be deleted? I believe this file is an orphaned file from an older binding structure
  2. The mqtt.properties file that was generated from the command above, don't include the texts from thing/channels.xml or thing/generic.thing.xml - @wborn is this perhaps a bug in the generate-default-translations maven plugin?
@lolodomo
Copy link
Contributor

lolodomo commented Feb 6, 2022

As there is only one translation file for the German translation with only 2 entries, I think it can be ignored. The i18n tool should simply be run to produce the default properties file.

@jimtng
Copy link
Contributor Author

jimtng commented Feb 6, 2022

As there is only one translation file for the German translation with only 2 entries, I think it can be ignored. The i18n tool should simply be run to produce the default properties file.

I just updated my original post above with some more details

@wborn
Copy link
Member

wborn commented Feb 6, 2022

is this perhaps a bug in the generate-default-translations maven plugin?

Yes it seems to be an issue for multi bundle bindings like MQTT because /OH-INF/binding/binding.xml is missing. If you'd temporarily add it by copying it over and then run the plugin it works better. 🙂

@jimtng
Copy link
Contributor Author

jimtng commented Feb 7, 2022

If you'd temporarily add it by copying it over and then run the plugin it works better.

Thanks, that worked. I will leave the binding.xml in there so future plugin runs can be done easily.

@jimtng
Copy link
Contributor Author

jimtng commented Feb 7, 2022

@wborn, I hit a snag with the translations generator tool. I'm not sure what id to use inside the binding.xml file for org.openhab.binding.mqtt.homeassistant and all the other org.openhab.binding.mqtt.* sub-bundles.

Using id="mqtt" for homeassistant

This is great because it will pick up the contents of config/homeassistant-channel-config.xml and also:

# thing types

thing-type.mqtt.homeassistant.label = HomeAssistant MQTT Component

The problem is that it generates this at the top of the properties file which conflicts with/overrides the main bundle org.openhab.binding.mqtt:

# binding

binding.mqtt.name = MQTT Binding for Homeassistant Convention
binding.mqtt.description = Supports Homeassistant convention in MQTT

Setting id= to anything else doesn't seem to be picking up the correct texts.

I don't want to manually edit the properties file because I believe it needs to be easily regenerated again in the future.

Would you be able to look into handling this scenario in the generator plugin?

wborn added a commit to wborn/openhab-core that referenced this issue Feb 11, 2022
The plugin did not generate translations for bundles of bindings that do not have a binding.xml file.
With this change it should also be possible to generate the default translations of the modbus and mqtt bindings.

Related to openhab/openhab-addons#12220

Signed-off-by: Wouter Born <github@maindrain.net>
@wborn
Copy link
Member

wborn commented Feb 11, 2022

Would you be able to look into handling this scenario in the generator plugin?

I think it should be fixed with openhab/openhab-core#2748 @jimtng.

cweitkamp pushed a commit to openhab/openhab-core that referenced this issue Feb 20, 2022
* Support multi bundle bindings in i18n-maven-plugin

The plugin did not generate translations for bundles of bindings that do not have a binding.xml file.
With this change it should also be possible to generate the default translations of the modbus and mqtt bindings.

Related to openhab/openhab-addons#12220

Signed-off-by: Wouter Born <github@maindrain.net>
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this issue Jul 12, 2023
* Support multi bundle bindings in i18n-maven-plugin

The plugin did not generate translations for bundles of bindings that do not have a binding.xml file.
With this change it should also be possible to generate the default translations of the modbus and mqtt bindings.

Related to openhab/openhab-addons#12220

Signed-off-by: Wouter Born <github@maindrain.net>
GitOrigin-RevId: c300410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants