Humanized units are not translatable
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-
2) At all times, the problem appears.
[Cause]
They are not marked as translatable.
Please look at the following code.
ubuntuone-
259 def humanize(
260 """Return a human readable representation of 'int_bytes'.
261
262 This method follows the https:/
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.
274 str_bytes = str_bytes.
275 return '%s %s' % (str_bytes, units[unit])
Related branches
- Manuel de la Peña (community): Approve
- Diego Sarmentero (community): Approve
-
Diff: 32 lines (+4/-4)1 file modifiedubuntuone/controlpanel/gui/__init__.py (+4/-4)
Changed in ubuntuone-control-panel: | |
assignee: | nobody → Ubuntu One Desktop+ team (ubuntuone-desktop+) |
status: | New → Triaged |
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 |
no longer affects: | ubuntuone-control-panel/stable-3-0 |