[ZBX-8934] Incorrect displaying of B, b, Bps, bps units conversion basis Created: 2014 Oct 21  Updated: 2017 May 30  Resolved: 2014 Dec 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.2.6, 2.4.1
Fix Version/s: 2.5.0

Type: Incident report Priority: Minor
Reporter: Alexey Pustovalov Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: units, usability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File screen.png    
Issue Links:
Duplicate
is duplicated by ZBX-5135 Wrong data in russian localization Closed

 Description   

In Russian it looks like "?B", '?bps'...



 Comments   
Comment by Pavels Jelisejevs (Inactive) [ 2014 Oct 27 ]

Unit prefixes should not be translated.

Also please provide and attach a patch for 2.2 and 2.4.

Comment by Alexei Vladishev [ 2014 Oct 27 ]

It should be fixed in trunk only. Backported patches must be provided for both 2.2 and 2.4.

Comment by Arvids Godjuks (Inactive) [ 2014 Oct 29 ]

Fixed in dev branch svn://svn.zabbix.com/branches/dev/ZBX-8943

Comment by Arvids Godjuks (Inactive) [ 2014 Oct 29 ]

(1) Translation string changes

Remove translation strings:
"B" - context "Byte short"
"K" - context "Kilo short"
"M" - context "Mega short
"G" - context "Giga short
"T" - context "Tera short
"P" - context "Peta short
"E" - context "Exa short
"Z" - context "Zetta short"
"Y" - context "Yotta short"

oleg.egorov Please add new changes in string changes list

Remove translation strings:
"Kilo"
"Mega"
"Tera"
"Peta"
"Exa"
"Zetta"
"Yotta"

CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Oct 31 ]

(2) Please remove 'long' option in func.inc.php:662
I don't find any execution

		$digitUnits[$step] = array(
			array('pow' => 0, 'short' => '', 'long' => ''),
			array('pow' => 1, 'short' => 'K', 'long' => _('Kilo')),
			array('pow' => 2, 'short' => 'M', 'long' => _('Mega')),
			array('pow' => 3, 'short' => 'G', 'long' => _('Giga')),
			array('pow' => 4, 'short' => 'T', 'long' => _('Tera')),
			array('pow' => 5, 'short' => 'P', 'long' => _('Peta')),
			array('pow' => 6, 'short' => 'E', 'long' => _('Exa')),
			array('pow' => 7, 'short' => 'Z', 'long' => _('Zetta')),
			array('pow' => 8, 'short' => 'Y', 'long' => _('Yotta'))
		);

Use defines in fuc.inc.php:710

	switch ($options['convert']) {
		case 0: $options['units'] = trim($options['units']);
		case 1: $desc = $valUnit['short']; break;
		case 2: $desc = $valUnit['long']; break;
	}

And remove

case 2: $desc = $valUnit['long']; break;

arvids.godjuks RESOLVED in r50515

oleg.egorov CLOSED

Comment by Arvids Godjuks (Inactive) [ 2014 Nov 07 ]

(3) Translation string changes

Remove translation strings:
"Kilo"
"Mega"
"Tera"
"Peta"
"Exa"
"Zetta"
"Yotta"

oleg.egorov CLOSED

Comment by Aleksandrs Saveljevs [ 2014 Nov 11 ]

Wouldn't removing unit prefix translations break those installations that actually happen to use native units?

We have a list of blacklisted units like "rpm" for which we do not apply unit prefixes. Maybe we could make a similar blacklist of units for which we do not translate unit prefixes, but do translate them for the rest?

Comment by Arvids Godjuks (Inactive) [ 2014 Nov 13 ]

This change only touches specific unit, the bytes, that represents the disk space or memory amounts and nothing else. It was coded in a way, that translated only the prefix, example for russian language: КB should be КБ, МB should be МБ, GB should be ГБ, ТB should be ТБ. Since the "B" part of the unit was never translated, and per the task I was given, I have removed the prefix translation, so these units are always displayed in english as KB, MB, TB, GB and so on.
Not applying the prefixes isn't really an option, because displaying even a terrabyte in it's original byte form is a number with 10 digits.

asaveljevs My comment was referring to https://www.zabbix.com/documentation/2.2/manual/config/items/item#unit_blacklist - this is a hardcoded list of units that we do not apply prefixes for. Suggestion was to make a similar list of hardcoded units, for which we apply a prefix, but do not translate it (like B, b, Bps, bps). For units not on this list, translate a prefix as before (so that the amount of apples in Moscow is rendered as "Гяблоко", not "Gяблоко").

oleg.egorov As was been discussed with dotneft unit prefixes should not be translated without blacklist

Comment by Arvids Godjuks (Inactive) [ 2014 Nov 25 ]

Merged to 2.5.0 (trunk)

Comment by Alexander Vladishev [ 2014 Nov 26 ]

(4) Documentation changes:

arvids.godjuks RESOLVED

martins-v Reviewed, with some small grammar fixes. CLOSED.

Generated at Fri Apr 19 13:12:34 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.