pseudo translation tool creates uncompilable PO files

Bug #1563005 reported by Doug Fish
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
High
Unassigned

Bug Description

Attempting to compile PO files generated by the pseudo translation tool results in the following error

CommandError: Execution of msgfmt failed: /opt/stack/horizon/openstack_dashboard/locale/tr_TR/LC_MESSAGES/django.po:10595: a format specification for argument 'req' doesn't exist in 'msgstr[0]'
msgfmt: found 1 fatal error

The problem message appears to be
#: openstack_dashboard/dashboards/project/instances/workflows/create_instance.py:213
#, python-format
msgid ""
"The requested instance cannot be launched as you only have %(avail)i of "
"your quota available. "
msgid_plural ""
"The requested %(req)i instances cannot be launched as you only have "
"%(avail)i of your quota available."
msgstr[0] ""
"[~0:The requested instance cannot be launched as you only have %(avail)i "
"of your quota available. ~您好яшçあ~~~~~~~~~~~~~~~~~~]"

It seems that that Babel really wants the translated string to have the substitution variables from msgid_plural, but the string is based on msgid

Tags: i18n
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/298379

Changed in horizon:
assignee: nobody → Doug Fish (drfish)
status: New → In Progress
Revision history for this message
Doug Fish (drfish) wrote :

This is broken in Mitaka right now. It would be nice to have to support debugging translation issues.

tags: added: mitaka-backport-potential
Changed in horizon:
milestone: none → newton-1
importance: Undecided → High
Changed in horizon:
milestone: newton-1 → newton-2
Changed in horizon:
milestone: newton-2 → newton-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Rob Cresswell (<email address hidden>) on branch: master
Review: https://review.openstack.org/298379
Reason: Abandoning for now, hasn't been updated in 4 months. Feel free to restore and update if you get time to work on the patch. Thanks!

Revision history for this message
Rob Cresswell (robcresswell-deactivatedaccount) wrote :

Removed assignee and reset status due to inactivity

Changed in horizon:
assignee: Doug Fish (drfish) → nobody
status: In Progress → New
milestone: newton-3 → next
status: New → Confirmed
Akihiro Motoki (amotoki)
tags: removed: mitaka-backport-potential
Changed in horizon:
assignee: nobody → Rob Cresswell (robcresswell)
Revision history for this message
Akihiro Motoki (amotoki) wrote :

After investigating the detail, this is caused by the same reason as for bug 1630507.

In the format of PO, theoretically we accept different substitution for a singular and plural forms. However, GNU gettext implementation does not allow this. The error reported in this bug is caused by GNU gettext implementation details.

We already changes the string to have the same substitution for all plural cases including a singular form as a fix of bug 1630507, so I believe this bug no longer exists.

tags: added: i18n
Changed in horizon:
status: Confirmed → Invalid
milestone: next → none
assignee: Rob Cresswell (robcresswell) → nobody
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.