-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[tapocontrol] Move error messages to i18n #14790
Conversation
45ca75f
to
518fe20
Compare
Signed-off-by: Christian Wild <[email protected]>
...control/src/main/java/org/openhab/binding/tapocontrol/internal/helpers/TapoErrorHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/i18n/tapocontrol.properties
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/i18n/tapocontrol.properties
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/i18n/tapocontrol.properties
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/i18n/tapocontrol.properties
Outdated
Show resolved
Hide resolved
Your approach looks strange. If you want to provide generic messages with a number as parameter, you do not need to duplicate entries to be translated. Create one with a parameter, something like |
And your way to retrieve the constant name to get the i18n entry is not very good.
Then your i18n entry can be built using |
Thanks for your hint. Changed it and hope it's okay now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks clearly better.
...control/src/main/java/org/openhab/binding/tapocontrol/internal/helpers/TapoErrorHandler.java
Outdated
Show resolved
Hide resolved
...control/src/main/java/org/openhab/binding/tapocontrol/internal/helpers/TapoErrorHandler.java
Outdated
Show resolved
Hide resolved
...control/src/main/java/org/openhab/binding/tapocontrol/internal/helpers/TapoErrorHandler.java
Outdated
Show resolved
Hide resolved
...control/src/main/java/org/openhab/binding/tapocontrol/internal/helpers/TapoErrorHandler.java
Outdated
Show resolved
Hide resolved
...control/src/main/java/org/openhab/binding/tapocontrol/internal/helpers/TapoErrorHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/i18n/tapocontrol.properties
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/i18n/tapocontrol.properties
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tapocontrol/src/main/resources/OH-INF/i18n/tapocontrol.properties
Outdated
Show resolved
Hide resolved
moved constants from class to enum Signed-off-by: Christian Wild <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you
* [tapocontrol] Moved error messages to i18n --------- Signed-off-by: Christian Wild <[email protected]> Signed-off-by: Thomas Burri <[email protected]>
* [tapocontrol] Moved error messages to i18n --------- Signed-off-by: Christian Wild <[email protected]> Signed-off-by: Matt Myers <[email protected]>
* [tapocontrol] Moved error messages to i18n --------- Signed-off-by: Christian Wild <[email protected]> Signed-off-by: Jørgen Austvik <[email protected]>
before this pr error messages were declared as constant.
moved them to i18n