-
-
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
[knx] Improve localization #13293
[knx] Improve localization #13293
Conversation
This is still work in progress. It adds German translations to the KNX binding. I would appreciate any feedback on the general approach how to add the translations.
Thanks! |
@lolodomo could you give some input to the questions above or recommend whom to ask? Thanks! |
This page might also shed some light: https://www.openhab.org/docs/developer/utils/i18n.html#managing-translations
I don't understand this question, can you elaborate?
Yes.
At least once per day.
I believe it's a time trigger, but it can also be triggered manually by admins.
Preferably proof-readers, but I'm not sure we have many yet. So actually, this question I cannot answer - @lolodomo, can you?
Yes.
Each binding has its own namespace, so you don't need to use any prefixes to secure uniqueness. Best advice for custom texts would be to try to avoid potential conflicts with framework-generated strings/prefixes.
It will change dynamically when user changes regional settings. |
4752060
to
1bf25e7
Compare
@jlaur thanks for the feedback.
This was about how to introduce a new language to a binding. Is it intended to download the property file for the new language from Crowdin and add it to the binding - and after this the bot takes over for further updates? Or should I just add empty files like
That would be interesting. We seem to have unapproved translations for KNX (de). According to the docs the bot will not include them, correct? |
Neither. New languages are automatically provided from Crowdin.
Correct. |
@jlaur For me it is still not clear what actually triggers a new language file to be added in the first place. For example, there is a |
The important sentence from the documentation is this one: "Please note that all texts must be translated and approved in order to be included." So for a language to be included in PR's created from Crowdin, 100% of strings must be translated, and 100% must be approved. So it is not because In German only 82% are approved. @cweitkamp, would you be able to have a look at the pending knx translations and/or possible shed some more light on the approval process? |
Done. |
@holgerfriedrich - the German translation is now merged: #13448. |
0fecab5
to
95b5233
Compare
- introduce localization of error messages - add new strings for common exceptions - provide helper functions for translation - add test cases Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
95b5233
to
1b90322
Compare
thanks, @cweitkamp ! |
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
@kaikreuzer could you please have a look? I'd Like to close this before getting deeper into the data secure topic again... Thanks! |
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.
Thanks! I've added some feedback. Perhaps @kaikreuzer would like to have a second look.
....binding.knx/src/main/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProvider.java
Outdated
Show resolved
Hide resolved
....binding.knx/src/main/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProvider.java
Outdated
Show resolved
Hide resolved
...ding.knx/src/test/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProviderTest.java
Outdated
Show resolved
Hide resolved
...ding.knx/src/test/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProviderTest.java
Outdated
Show resolved
Hide resolved
...nding.knx/src/test/java/org/openhab/binding/knx/internal/i18n/MockedTranslationProvider.java
Outdated
Show resolved
Hide resolved
....binding.knx/src/main/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProvider.java
Show resolved
Hide resolved
....binding.knx/src/main/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProvider.java
Outdated
Show resolved
Hide resolved
....binding.knx/src/main/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProvider.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
@jlaur thanks for the review! I think I addressed all of your comments. I left one conversation open, explaining why I used the enum to implement the singleton. |
@jlaur is the much better reviewer for this, so he can merge right away once he is done. |
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.
I've added some minor comments. Let's merge after you had a chance to have a look. :-)
...binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/IPBridgeThingHandler.java
Outdated
Show resolved
Hide resolved
....binding.knx/src/main/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProvider.java
Outdated
Show resolved
Hide resolved
....binding.knx/src/main/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProvider.java
Outdated
Show resolved
Hide resolved
...ding.knx/src/test/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProviderTest.java
Outdated
Show resolved
Hide resolved
...ding.knx/src/test/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProviderTest.java
Outdated
Show resolved
Hide resolved
...nding.knx/src/test/java/org/openhab/binding/knx/internal/i18n/MockedTranslationProvider.java
Outdated
Show resolved
Hide resolved
....binding.knx/src/main/java/org/openhab/binding/knx/internal/i18n/KNXTranslationProvider.java
Show resolved
Hide resolved
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
@jlaur, thanks. Finally, you convinced me to exchange the strings for the unit test :-) |
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, thanks!
@cweitkamp maybe you could approve the translations for the new strings introduced in this PR once again? I have uploaded German translations to Crowdin. Thanks! |
Done. |
* [knx] Improve localization - introduce localization of error messages - add new strings for common exceptions - provide helper functions for translation - add test cases Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* [knx] Improve localization - introduce localization of error messages - add new strings for common exceptions - provide helper functions for translation - add test cases Signed-off-by: Holger Friedrich <mail@holger-friedrich.de> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
* [knx] Improve localization - introduce localization of error messages - add new strings for common exceptions - provide helper functions for translation - add test cases Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* [knx] Improve localization - introduce localization of error messages - add new strings for common exceptions - provide helper functions for translation - add test cases Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* [knx] Improve localization - introduce localization of error messages - add new strings for common exceptions - provide helper functions for translation - add test cases Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: Holger Friedrich mail@holger-friedrich.de