Humanized units are not translatable

Bug #985333 reported by Jiro Matsuzawa
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Control Panel
Status tracked in Trunk
Stable-4-0
Fix Released
Undecided
Unassigned
Trunk
Fix Released
Undecided
Roberto Alsina

Bug Description

Humanized units such as "bytes" are not translatable on the top section of the panel.
The units appear in the string '%(used)s of %(total)s'.
Please refer to the attached screenshot.

[Steps to reproduce]
0) Set up your ubuntuone account.
1) Launch ubuntuone-control-panel-qt
2) At all times, the problem appears.

[Cause]
They are not marked as translatable.
Please look at the following code.
ubuntuone-control-panel-3.0.0/ubuntuone/controlpanel/gui/__init__.py:
259 def humanize(int_bytes):
260 """Return a human readable representation of 'int_bytes'.
261
262 This method follows the https://wiki.ubuntu.com/UnitsPolicy to build
263 the result.
264
265 """
266 units = {0: 'bytes', 1: 'KiB', 2: 'MiB', 3: 'GiB', 4: 'TiB',
267 5: 'PiB', 6: 'Eib', 7: 'ZiB', 8: 'YiB'}
268 unit = 0
269 while int_bytes >= KILOBYTES:
270 int_bytes = int_bytes / float(KILOBYTES)
271 unit += 1
272 str_bytes = "%.1f" % int_bytes
273 str_bytes = str_bytes.rstrip('0')
274 str_bytes = str_bytes.rstrip('.')
275 return '%s %s' % (str_bytes, units[unit])

Related branches

Revision history for this message
Jiro Matsuzawa (jmatsuzawa) wrote :
Rick McBride (rmcbride)
Changed in ubuntuone-control-panel:
assignee: nobody → Ubuntu One Desktop+ team (ubuntuone-desktop+)
status: New → Triaged
Roberto Alsina (ralsina)
Changed in ubuntuone-control-panel:
assignee: Ubuntu One Desktop+ team (ubuntuone-desktop+) → Roberto Alsina (ralsina)
status: Triaged → In Progress
Changed in ubuntuone-control-panel:
status: In Progress → Fix Committed
dobey (dobey)
no longer affects: ubuntuone-control-panel/stable-3-0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.