Ask Your Question

ugettext_lazy instead of ugettext for locale?

asked 2013-02-11 18:28:27 -0500

joe-topjian-v gravatar image


I'm not sure if this is a bug, so I wanted to post here first to confirm.

We want to support a french locale in Horizon and reviewed/modified the PO file to make sure it had proper entries for all supported areas. However, when switching from English to French, we find that not all areas are translated even though they are marked translatable in the code ( _("Foobar")).

I was able to resolve this issue by changing

from django.utils.translation import ugettext as _ to from django.utils.translation import ugettext_lazy as _

This change enabled previously untranslated areas to become translated. The reason for this is described and further linked here ( ( ).

An example of this can be seen by doing the above fix to "dashboards/nova/instances/" (Folsom).

Can anyone confirm if this is a known issue or if this is a newly discovered bug?

Thanks, Joe

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2013-02-13 16:29:49 -0500

joe-topjian-v gravatar image

Sounds good. Thanks!

edit flag offensive delete link more

answered 2013-02-11 22:05:10 -0500

joe-topjian-v gravatar image

On further review through the code, it looks like only a handful of files have ugettext instead of ugettext_lazy -- I'm going to assume this is a bug and that all occurrences should be changed?

edit flag offensive delete link more

answered 2013-02-12 13:55:21 -0500

jpichon gravatar image

I think you are correct, it sounds like a bug to me.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-02-11 18:28:27 -0500

Seen: 223 times

Last updated: Feb 13 '13