A few "cosmetic bugs" in the user interface

Moderator: leecollings

Post Reply
User avatar
PeGe
Posts: 25
Joined: Tuesday 31 January 2017 14:21
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.6328
Location: Sollentuna, Sweden
Contact:

A few "cosmetic bugs" in the user interface

Post by PeGe »

First; I noticed that the display text "Humidity %" always appears near the right hand side of the temperature graphs, even if the affected sensor is of type 'temperature-only'. However, there is apparently some conditional logic that automatically removes the "numeric scale percentage notation" from these graphs. So the same conditional logic would just need to be applied to the "Humidity %" string as well.

Second; It seems like the left hand side display text "degrees Celsius" in the same graphs is not translatable. Even though the "Celsius" part of the string is international, the word "degrees" is not...

Third; The string "Last seen" is currently not part of the translatable display texts, as I found it to be hard coded in the CSS. (Easy to fix locally by a dirty CSS hack, but still...)

Fourth; To my understanding this has already been mentioned elsewhere, but I still want to point it out: The word "Language" on the setup page.

I deem these flaws as merely cosmetic, so the priority can definitely be considered low. But it would be nice to have them sorted at some point in time. 8-)

/P-G
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: A few "cosmetic bugs" in the user interface

Post by gizmocuz »

True, could you submit a git pull request for this ?

Specially the '3th' statement, i tried, but failed...
We need a CSS/Javascript hack, as the 'Last seen' is inside the CSS
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: A few "cosmetic bugs" in the user interface

Post by gizmocuz »

#1 will be solved in a next beta, adding 'showEmpty: false' to the yAxis solved the problem

#4, not sure what you mean with this
Quality outlives Quantity!
User avatar
PeGe
Posts: 25
Joined: Tuesday 31 January 2017 14:21
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.6328
Location: Sollentuna, Sweden
Contact:

Re: A few "cosmetic bugs" in the user interface

Post by PeGe »

Hi gizmocuz,

First let me say I admire your commitment towards constantly improving both the core software as well as the user experience. - Impressive!

Now, to clarify point #4 in my original posting:
  • In the top left hand portion of the 'Settings' page, under 'System settings' and 'User interface', you find the "Language" selection. No matter what language you currently use, that specific attribute name string, i.e. the word "Language", always stays the same.
I hope that clarifies the issue. Again; thanks for your quick response!

/P-G
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: A few "cosmetic bugs" in the user interface

Post by gizmocuz »

That is correct, and also intended.
If someone puts my domoticz in Arabic language, i still want to understand it. This string will not be translated.

Do you have some code for #3 maybe ?
Quality outlives Quantity!
User avatar
PeGe
Posts: 25
Joined: Tuesday 31 January 2017 14:21
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.6328
Location: Sollentuna, Sweden
Contact:

Re: A few "cosmetic bugs" in the user interface

Post by PeGe »

OK, I see your point! And it makes sense to leave that wording "as-is".

Let me look into what I can do with #3. As for myself, I simply edited the CSS in my own installation, but that raw quick-and-dirty hack is clearly just a local short-term workaround. However, I recall noticing some other CSS based strings that are actually subjected to translation, so the mechanism is obviously in place already. But I didn't dig deeper into the matter at that time.

EDIT: My mistake above! No mechanism for "locale-aware" CSS seems to be in place. I will check for other options...

I will report back if/when I come up with a permanent solution!

/P-G
User avatar
PeGe
Posts: 25
Joined: Tuesday 31 January 2017 14:21
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.6328
Location: Sollentuna, Sweden
Contact:

Re: A few "cosmetic bugs" in the user interface

Post by PeGe »

I said I would look into it, so I finally took me a little time tonight. Here is a reasonably simple solution that I came up with, to enable the translation of the "Last Seen:" label.

EDIT: I also took the opportunity to resolve the same issue with the "Type:" labels, as that string was also defined in the CSS. It should be noted that both of the translated strings already exist in the localized language files. But they were never actually used before, since there was no mechanism for handling localization of strings defined in the CSS files!

First, I commented out ALL of the sections (there are 8 or 9 of these) in the 'style.css' that were setting the "content" and "font-style" properties on the "Last Seen" fiels. Additionally, I did the same for ALL the sections (I think there were 3) targeting the "Type" fields. Below are examples of such sections:

Code: Select all

/* body table#itemtable tr td:first-child + td + td + td + td:before{
        content: "Last Seen: ";
        font-style: italic;
} */


/* body table#itemtable tr td:first-child + td + td + td + td:before{
        content: "Type: ";
        font-style: italic;
} */

Then I introduced the following lines at the very beginning of a js that was loaded when a page was initialized. For my little Proof-Of-Concept here, I did it in 'DashboardController.js', but maybe it should go into one of the more generic JavaScripts instead, to assure that it will be used on all pages:

Code: Select all

var langLastSeen='"' + ($.t("Last Seen")) + ': ";';
var langTypeText='"' + ($.t("Type")) + ': ";';
document.styleSheets[0].insertRule('td#lastupdate::before { content: ' + langLastSeen + '; font-style: italic;}', 0);
document.styleSheets[0].insertRule('td#type::before { content: ' + langTypeText + '; font-style: italic;}', 0);
Just a short note: Over the years, I have written in more than 20 different programming/scripting languages, but javascript is definitely NOT one of my favorites, so the code might appear a bit primitive. Especially the awkward way I pad on the required quotes to the local variable strings, but it works. Please see it mainly as a Proof-Of-Concept and feel free to do whatever tweaking you deem necessary!

And please also be aware that I have not verified if these modifications possibly might have some other unforeseen implications!

/P-G
User avatar
PeGe
Posts: 25
Joined: Tuesday 31 January 2017 14:21
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.6328
Location: Sollentuna, Sweden
Contact:

Re: A few "cosmetic bugs" in the user interface

Post by PeGe »

I did some further testing this morning, and it seems to work fine. I have not seen any negative consequences so far.

A few screenshots of various languages below:
Attachments
Switch_de.png
Switch_de.png (20.27 KiB) Viewed 2840 times
Switch_se.png
Switch_se.png (19.92 KiB) Viewed 2840 times
Switch_en.png
Switch_en.png (19.08 KiB) Viewed 2840 times
Xztraz
Posts: 107
Joined: Tuesday 31 January 2017 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: A few "cosmetic bugs" in the user interface

Post by Xztraz »

if you can modify dark theme with those i could happily test :)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest