-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
[i18n] Refactoring and annotations #1161
Conversation
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
…Util' Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
…ot successful Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
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! Setting the TranslationProvider using the constructor in the utility classes helps a lot with reducing the number of method parameters and simplifying the code.
Did you also consider creating components out of those utility classes (ModuleI18nUtil, ModuleTypeI18nUtil, RuleTemplateI18nUtil)? It might make the classes using those Util classes easier to unit test when instead of the Util classes some Mocks can be injected.
I also have one small comment below.
.../main/java/org/openhab/core/automation/internal/provider/AbstractResourceBundleProvider.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
No, I did not. We have different i18n services / components which should be used by other bundles if they need localized entities. My understandig of those utility classes is that they are internal and only be used by the i18n services itself as singleton object - more or less to reduce lines of code / to source out the code for better maintainability of the i18n services. |
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 now!
Fixes openhab#1161 Signed-off-by: Wouter Born <github@maindrain.net>
* Added nullness annotations to 'RuleTemplateI18nUtil' * Added nullness annotations to 'ConfigDescriptionGroupI18nUtil' * Moved 'ConfigDescriptionI18nUtil' into internal package * Moved 'ConfigDescriptionGroupI18nUtil' into internal package * Moved 'ThingTypeI18nUtil' into internal package * Use 'ConfigI18nLocalizationService' instead of 'ConfigDescriptionI18nUtil' * Use default labels / descriptions if application of localization is not successful * Resolved itest.bndrun files Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de> GitOrigin-RevId: 12d91f7
ConfigI18nLocalizationService
instead ofConfigDescriptionI18nUtil
in other packages thano.o.c.config.*
Signed-off-by: Christoph Weitkamp github@christophweitkamp.de