Comment 2 for bug 1255004

Revision history for this message
Akihiro Motoki (amotoki) wrote :

I agree that such strings should not be marked as translatable.

IMO, _() should be used only for string literals and should not be used for variables (in this case "_(role.name)"). In Horizon _ is evaluated in lazy mode and it leads to unpredictable results (i.e., if we have a corresponding entry in PO file a string will be displayed using localized string, otherwise a English string is displayed).

According to grep result, the following can be a problem.
(The first one is a bit different though)

horizon/exceptions.py:172: return _(self.msg) % self.attrs
openstack_dashboard/dashboards/admin/domains/workflows.py:106: label = _(role.name)
openstack_dashboard/dashboards/project/access_and_security/security_groups/forms.py:250: common_rules = [(k, _(rules_dict[k]['name']))