cleanup translation in a file - replacing with underscore

Bug #1351478 reported by Cindy Lu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Veena

Bug Description

As suggested by: https://review.openstack.org/#/c/107755/1/horizon/templatetags/sizeformat.py

This file https://github.com/openstack/horizon/blob/master/horizon/templatetags/sizeformat.py should cleanup some of the translation stuff.

from django.utils import translation
...
return translation.ungettext_lazy("%(size)d Byte",
                "%(size)d Bytes", 0) % {'size': 0}

should be replaced with:

from django.utils.translation import ugettext_lazy as _
...
return _("%(size)d Byte", "%(size)d Bytes", 0) % {'size': 0}

replace instances with _.

Cindy Lu (clu-m)
tags: added: low-hanging-fruit
Veena (mveenasl)
Changed in horizon:
assignee: nobody → veena (mveenasl)
Revision history for this message
Julie Pichon (jpichon) wrote :
Julie Pichon (jpichon)
Changed in horizon:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/112373

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/112383

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Julie Pichon (<email address hidden>) on branch: master
Review: https://review.openstack.org/112383
Reason: Abandoning this patch since the other one is being updated. Thank you!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/112373
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=dd2e1997c974c3b94ca84e75df92e9baa4ccbba7
Submitter: Jenkins
Branch: master

commit dd2e1997c974c3b94ca84e75df92e9baa4ccbba7
Author: veena <email address hidden>
Date: Wed Aug 6 23:34:12 2014 +0530

    Cleans up the translation

    Replaces translation.ungettext_lazy with
    ungettext_lazy by importing ungettext_lazy from django.utils.translation
    Replaces translation.ugettext_lazy with _
    by importing ugettext_lazy as _ from django.utils.translation

    Closes-Bug: 1351478

    Change-Id: I1b0415bcd5d9b5b0e3f1328f0289c4ca381e02cd

Changed in horizon:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
tags: added: i18n
Changed in horizon:
milestone: none → juno-3
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-3 → 2014.2
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.