cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Admin Dashboard System Capacity broken with German Locale

Open mdesaive opened this issue 8 years ago • 12 comments

ISSUE TYPE
  • Bug Report
COMPONENT NAME
UI
CLOUDSTACK VERSION
4.11
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

With german locale settings, the graphics in the section "System Capacity" in the Dashboard are displayed incorrectly.

STEPS TO REPRODUCE
echo LANG=\"de_DE.UTF-8\" > /etc/default/locale

service cloudstack-management restart

Login to CloudStack Web-UI
EXPECTED RESULTS
See the graphics for "System Capacity" displayed correctly.
ACTUAL RESULTS
The graphics show all red circles.

mdesaive avatar Apr 06 '18 08:04 mdesaive

@mdesaive I am assuming that the line echo "LANG="de_DE.UTF-8" > /etc/default/locale to should read echo LANG="de_DE.UTF-8" > /etc/default/locale

Did you test any other locales? thanks

DaanHoogland avatar Apr 06 '18 09:04 DaanHoogland

After noting that issue we simply switched to "C" and added LANG and LC_ALL just for convenience to roots ~/.bashrc

s-seitz avatar Apr 06 '18 09:04 s-seitz

@DaanHoogland thanks for the correction. I updated the description.

Just took the time to try to reproduce the issue once again and it worked even for german locale settings. :( I am unsure if some collegue changed other settings.

Please wait before investigating into this, I will look into it the next days and maybe update the description once more.

And answering your question: We did not test any other locales. We just ran into this issue because our default locale was "de_DE.UTF-8"

mdesaive avatar Apr 06 '18 18:04 mdesaive

Tested with en_AU, pt_BR, and de_DE (all UTF-8). for pt_BR and de_DE I got the same results (the issue reported here). For en_AU, everything worked just fine.

rafaelweingartner avatar Apr 06 '18 18:04 rafaelweingartner

Yes. I reported correctly. The bug reproduces like described with the default installation.

My colleague patched the init script to set LANG/LC_ALL=C. ;)

Thanks for your effort!

mdesaive avatar Apr 07 '18 04:04 mdesaive

I followed the step to set the locale to de_DE.UTF-8, restarted the mgmt server and before log in selected German as language. After login I see this (not sure if this has any error, maybe translation?): screenshot from 2018-05-09 16-25-41

@mdesaive @rafaelweingartner @DaanHoogland what is the expected error/screenshot and any ideas on fixing it. I'll remove the milestone of 4.11.1.0 on this as I'm not sure how to approach a fix to the reported issue.

yadvr avatar May 09 '18 10:05 yadvr

@rhtyd answering on behalf of @mdesaive , the error is not triggered by selecting another language inside the UI at the login prompt. Instead, it occurs if the system locale (LANG environment variable) is set to a region with comma as decimal "point". e.g. in germany float is noted as NN,NNN .

At least for debian/ubuntu prior systemd /etc/init.d/cloudstack-management contains

if [ -r /etc/default/locale ]; then . /etc/default/locale export LANG fi

we simple fixed this via

:~# cat /etc/default/locale ###LANG="de_DE.UTF-8" ## Cloudstack 4.11 Bug Decimalpoint versus Comma, we need a Point LANG=C LC_ALL=C

s-seitz avatar May 11 '18 12:05 s-seitz

I think more then just German locales will show this error, if the comma is the issue. We just haven't encountered them. I think this must be fixed with an in UI translation of the data coming in from the server, in the API response.

DaanHoogland avatar Jun 07 '18 11:06 DaanHoogland

This problem still persists. Affects too the Spanish locale (es_ES)

gentakojima avatar May 24 '19 10:05 gentakojima

I'm not sure how to fix this one, any ideas @DaanHoogland @rafaelweingartner ? Should we export LANG via the /etc/default/cloudstack-management or open a docs PR?

yadvr avatar Jun 25 '19 10:06 yadvr

@rhtyd we need to test that if we force LANG=C on the server we have no issues on the UI. If that's the case your solution should/could/would solve this. Being Dutch, I never use Dutch, so I have no experience with this. (Dutch also uses a decimal comma instead of a point and uses the point for thousands separation to make things worse) In general I prefer the reasonable default over the good documentation, if that answers your question.

DaanHoogland avatar Jun 26 '19 11:06 DaanHoogland

Checked not reproducible @mdesaive can you test against Primate and re-open if you can reproduce against latest master or Primate. Thanks.

yadvr avatar Aug 12 '20 08:08 yadvr