Created attachment 1249022 [details] fr_FR numbers Description of problem: For fr_FR and es_ES locales, some numbers are displayed as 'NaN' on the Dashboard tab. For e.g. under Global Utilization - memory section, the string in English is displayed as 21.4 Available of 23.2 GiB Whereas the corresponding string in fr_FR is displayed as - 21,4 Disponible parmi NaN GiB This is observed with storage section as well. Please refer attached screenshot. This is applicable for es_ES locale as well. Version-Release number of selected component (if applicable): 4.1.0.3-0.1.el7 How reproducible: always Steps to Reproduce: 1.login with fr_FR or es_ES locale to admin portal. 2.go to dashboard tab. 3.observe the strings under memory or storage section under global utilization for available space/memory. Actual results: '21.4 Available of 23.2 GiB' is displayed as '21,4 Disponible parmi NaN GiB' for fr_FR locale. Expected results: Proper numbers should be displayed instead of NaN. Additional info: Not sure, but it might be because of the way in which numbers with decimals are written in fr_FR or es_ES locales - for e.g. 21,4 GiB instead of 21.4 GiB in en_US or other locales.
Scott, can you take a look?
This is being caused because the number is being formatted to a locale specific string (e.g. "12.3156" to "12,3") and then is given to a message format that expects a number value as one of the substitutions (e.g. "of {total, number} {unit}"). The message formatter can't convert "12,3" to the number 12.3 and it renders a NaN instead. The solution is to either round the numbers as appropriate and then pass them as numbers to the message formatter or to update the message format to include rounding. I'll investigate if the message formatter we use supports formatting numbers how we want. If it can, then I can update all the message (and translations) or I can update the code so the numbers aren't formatted on the way in but get rounded first.
Code was changed to round numbers properly prior to being formatted in messages. I don't see a point making translators worry about the decimal precision.
*** Bug 1489152 has been marked as a duplicate of this bug. ***
Verified in ovirt-engine-4.2.0.2-0.1.el7.noarch ovirt-engine-dashboard-1.2.0-1.el7ev.noarch The number formatting now looks ok for all locales. I haven't found any 'NaN' on the Dashboard. Checked on the Global Utilization cards, as well as in the Top Utilized Resources dialogs. Screenshot of the fixed Dashboard (fr_FR locale) is attached.
Created attachment 1368611 [details] screen: Dashboard - fixed number formatting
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017. Since the problem described in this bug report should be resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.