-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Dynamically load the list of Semantic tags and store them in Vuex #1882
Conversation
99b87db
to
4cf0108
Compare
Job #1039: Bundle Size — 15.68MiB (-0.6%).Metrics (5 changes)
Total size by type (2 changes)
|
Anyway, there was a bug with localisation of the dynamically loaded tags that I've just fixed. |
Yes but it's usually put in cache whereas the additional REST query might not be :) I see a lot of translations removed in this PR but I would like to have them transferred somehow to their new place, probably in openhab-core, so they are not lost. |
Yeah, but to put them in cache we’d need caching support in core (last-modified etc)
There are already translations in openHAB core (see https://github.com/openhab/openhab-core/tree/main/bundles/org.openhab.core.semantics/src/main/resources), however I’m not sure if all translations from webui are there. |
Yes these are the synonyms for a tag (as you can see there could be more than one), and they could be complemented by the "synonyms" metadata. |
Core seems to take the translations from those synonyms files, so when removing our translations here we should make sure that all of them are included in the synonyms translations. |
These translations are (partly) missing at openHAB Core:
@ghys IMO the problem with migrating them is, that these translations are all only for singular forms of the semantics and without synonyms, but openHAB Core wants singular, plural and synonyms. Obviously, I cannot translate the missing parts. I propose to merge this PR and I will contact the contributors of these 7 listed translations that will be lost and ask for translating the semantics in openHAB Core. For Luxembourgish, you can probably translate? @kaikreuzer @cweitkamp |
@ghys Please see my comment. IMO we cannot block (UI) progress because of a few translations. |
@florian-h05 : openhab/openhab-core#3646 has been merged. |
Signed-off-by: Florian Hotze <[email protected]>
Signed-off-by: Florian Hotze <[email protected]>
Signed-off-by: Florian Hotze <[email protected]>
Signed-off-by: Florian Hotze <[email protected]>
Signed-off-by: Florian Hotze <[email protected]>
63d61ac
to
488d619
Compare
Refs openhab/openhab-core#3646. Signed-off-by: Florian Hotze <[email protected]>
What do you mean by the first time? |
This should make it much easier to trigger a reload from other parts of the UI once this is needed in the future. Signed-off-by: Florian Hotze <[email protected]>
85319e8
to
df102c3
Compare
AFAIK the To automatically make those refresh in MainUI, they need to be loaded every time. We could use ETags or Last-Modified do cache responses to avoid unnecessary traffic, but I‘d rather do this in another PR and it probably also requires core changes. There already is a PR to use this for Items, Things and rules, see #1661. |
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.
For Luxembourgish, you can probably translate?
Ech kann e bisschen lëtzebuergesch schwätzen... but it's not my forte...! (My German is better actually).
I'm good with the changes in the end, let's get it to OH4!
I will test the next snapshot to see how it behaves with user semantic tags. |
@florian-h05 : it looks like it works well. I added (using REST API) two new locations and 1 new equipment. After restarting MainUI, I can see these new semantic tags when I create a new group in Main UI and finally the new locations and the new kind of equipment appear in Location and Equipment tabs. Very good. Do you think you will find the time before OH4 is released to add a new page to manage semantic tags in Main UI ? |
A quick reminder that cache control should be implemented in core for the See |
👍
Unfortunately I’m very busy this week and away next week (10th to 14th July), so I fear that I won’t make it before the feature freeze. I’m hoping to at least finish the UoM stuff for the new release.
Thanks for noticing that. @lolodomo Can you do that? |
FYI: I have contacted the CrowdIn contributors a few seconds ago and asked them to re-contribute their translations at openhab-core. @kaikreuzer I also noted that the removed translations from MainUI are still in CrowdIn (https://crowdin.com/translate/openhab-webui/384), can you please remove them? |
@florian-h05 Could you tell me what exactly you want me to remove? |
With this PR, MainUI loads the semantic tags together with the translations from the REST API and we therefore do not use the translations at openhab-webui anymore. This PR also removed the transation files from the repo, but seems like this was not synced back to CrowdIn. @kaikreuzer EDIT: The translations to remove are semantics/en.json from the org.openhab.ui bundle. |
Fixes #1976. Follow-up for #1882. Signed-off-by: Florian Hotze <[email protected]>
Fixes #1976. Follow-up for #1882. Signed-off-by: Florian Hotze <[email protected]> (cherry picked from commit 2230f52)
Supersedes #1850.
Closes #1822.
Depends on openhab/openhab-core#3559 (already merged now).
Adding custom semantic tags is now possible: openhab/openhab-core#3519.
This PR loads the Semantic tags when MainUI is loaded the first time and stores them in Vuex.
This allows the removal of the hard-coded Semantic tags and the translations from the assets and therefore makes the initial JS smaller.