Page 1 of 1
A few "cosmetic bugs" in the user interface
Posted: Saturday 04 February 2017 0:08
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.
/P-G
Re: A few "cosmetic bugs" in the user interface
Posted: Saturday 04 February 2017 9:54
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
Re: A few "cosmetic bugs" in the user interface
Posted: Saturday 04 February 2017 10:05
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
Re: A few "cosmetic bugs" in the user interface
Posted: Saturday 04 February 2017 11:40
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
Re: A few "cosmetic bugs" in the user interface
Posted: Saturday 04 February 2017 11:43
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 ?
Re: A few "cosmetic bugs" in the user interface
Posted: Saturday 04 February 2017 12:09
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
Re: A few "cosmetic bugs" in the user interface
Posted: Sunday 05 February 2017 19:37
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
Re: A few "cosmetic bugs" in the user interface
Posted: Monday 06 February 2017 11:59
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:
Re: A few "cosmetic bugs" in the user interface
Posted: Monday 27 February 2017 14:27
by Xztraz
if you can modify dark theme with those i could happily test