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
Thing upgrade gives different result than recreating thing #3569
Comments
Most of that looks fine. The "channel label" is not considered during upgrade, that is why the label can be set in the update instruction, and it seems that works fine. The only issue I see is that the English version is used instead of the localized version in test 5 when a label is provided. Is that also the case if you use |
Would it be possible to consider the channel label during upgrade? I think that would be the only way to fully ensure consistency (with textual configuration and thing recreation).
I'll try to rerun that test to verify this. |
I didn't find a way to do that when I originally added the code, that's why I added the label/description instructions. I still think that the non-localized versions are much better than requiring to re-create the whole thing. Another thing you could try: |
@J-N-K - update on the two suggested variations of test case 5:
I fully agree on that. |
It would be interesting to know what happens if you create a new thing and then change the language. Do the labels/description change in that case? |
It solves the missing localization of the channel-type labels/descriptions but not for individual channel labels/descriptions. |
|
It seems not. I'm using file-based configuration, so haven't experienced this problem, but when testing a managed thing in OH 4, I didn't see the language change reflected in the UI. |
Sure, when that PR is merged I can try to re-run my manual tests. |
@jlaur : please let us know the new status now that the fix is merged. |
@lolodomo - done, status is that nothing changed for these specific tests. |
As I already said (and you confirmed): If the channel is created and localization changes, the channel label/description stays in the old language. It is quite difficult to get the correct label, but I'll have another look. |
Case 1 is fine. |
The only comment I have here is that if 2 and 3 would work, there would be no need for cases 5, 6 and 7 since they are a partial work-around for 2 and 3 not working (partial because localization is not supported). Otherwise I believe we all agree, but @J-N-K had a hard time trying to accomplish 2 and 3. It's still better than before, but so far nothing beats file-based things. 😉 |
Case 2 is when a label is defined on the channel itself (to override the channel type label). @J-N-K : is it a data not available when adding/updating the channel ? |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/come-back-and-learn-how-to-use-file-based-configuration/147067/15 |
This is a follow-up to openhab/openhab-docs#2040 (comment).
I have now tested the different update scenarios I could think of:
Retested after #3576 (build 3455), no changes.
Expected Behavior
Thing upgrade should give same result as recreating thing. At least I understand this as one of the motivations for #3330.
I would expect channel label to be considered and take precedence over channel type label.
I would additionally expect I18N localized strings to take precedence over English strings.
If it would work this way, update instruction labels would not be needed as they would be redundant.
All of this should apply to descriptions as well.
Current Behavior
Currently it's impossible to get it right with I18N. Update instruction label can be copied from channel label, which makes it almost correct, but then restricted to English.
Steps to Reproduce
I added this to a binding for testing:
instructions.xml
thing-types.xml
da.properties
The text was updated successfully, but these errors were encountered: