Merge lp:~ralsina/ubuntuone-control-panel/octetes into lp:ubuntuone-control-panel

Proposed by Roberto Alsina on 2012-05-14
Status: Merged
Approved by: Manuel de la Peña on 2012-05-14
Approved revision: 318
Merged at revision: 319
Proposed branch: lp:~ralsina/ubuntuone-control-panel/octetes
Merge into: lp:ubuntuone-control-panel
Diff against target: 32 lines (+4/-4)
1 file modified
ubuntuone/controlpanel/gui/__init__.py (+4/-4)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-control-panel/octetes
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve on 2012-05-14
Diego Sarmentero (community) 2012-05-14 Approve on 2012-05-14
Review via email: mp+105684@code.launchpad.net

Commit Message

 - Marked humanized units as translatable (Fixes LP:985333).

Description of the Change

Mark humanized units as translatable

To post a comment you must log in.
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Manuel de la Peña (mandel) wrote :

I like your octetes!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/gui/__init__.py'
2--- ubuntuone/controlpanel/gui/__init__.py 2012-04-05 14:52:55 +0000
3+++ ubuntuone/controlpanel/gui/__init__.py 2012-05-14 16:22:20 +0000
4@@ -253,8 +253,6 @@
5 ' Would you like to install it?')
6 QUIT_LABEL = _('Quit Ubuntu One')
7
8-# pylint: enable=E0602
9-
10
11 def humanize(int_bytes):
12 """Return a human readable representation of 'int_bytes'.
13@@ -263,8 +261,9 @@
14 the result.
15
16 """
17- units = {0: 'bytes', 1: 'KiB', 2: 'MiB', 3: 'GiB', 4: 'TiB',
18- 5: 'PiB', 6: 'Eib', 7: 'ZiB', 8: 'YiB'}
19+ units = {0: _('bytes'), 1: _('KiB'), 2: _('MiB'), 3: _('GiB'),
20+ 4: _('TiB'), 5: _('PiB'), 6: _('Eib'), 7: _('ZiB'),
21+ 8: _('YiB')}
22 unit = 0
23 while int_bytes >= KILOBYTES:
24 int_bytes = int_bytes / float(KILOBYTES)
25@@ -273,6 +272,7 @@
26 str_bytes = str_bytes.rstrip('0')
27 str_bytes = str_bytes.rstrip('.')
28 return '%s %s' % (str_bytes, units[unit])
29+# pylint: enable=E0602
30
31
32 def show_quota_warning(int_bytes_used, int_bytes_total):

Subscribers

People subscribed via source and target branches