Set --language=python for XGETTEXT_ARGS in po/Makefile

Bug #1358229 reported by Mitsuya Shibata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The ubuntu-support-status is a python script. However it doesn't
have extention, then xgettext recongnize as "source code of C".
ref: "Choice of input file language" in xgettext(1)

If code is treated as C, it will be not set "python-format" flag
and Launchpad translations validator does not work.

For example, in ubuntu-support-statatus has following code:
---
ubuntu-support-status:145-151

print(_("Support status summary of '%s':") % os.uname()[1])
print()
for (time, tset) in supported_by_time.items():
    print(_("You have %(num)s packages (%(percent).1f%%) supported until %(time)s") % {
        'num' : len(tset),
        'percent' : len(tset) * 100.0 / total,
        'time' : time})
---

xgettext generates following po templates:
---
#: ../ubuntu-support-status:142
#, c-format <- TREATED AS C-LANGUAGE, BUT NO PROBLEM
msgid "Support status summary of '%s':"
msgstr ""

#: ../ubuntu-support-status:145 <- NEEDS "#, python-format" TO VALIDATE ON LP
msgid "You have %(num)s packages (%(percent).1f%%) supported until %(time)s"
msgstr ""
---

If any translator translate following (missing last 's'), Launchpad does not
treat as error, but occur exception on exec ubuntu-support-sutatus script.
---
msgid "You have %(num)s packages (%(percent).1f%%) supported until %(time)s"
msgstr "You have %(num)s packages (%(percent).1f%%) supported until %(time)"
---

It seems that update-manager only has python script.
Could you set --language=python for XGETTEXT_ARGS in po/Makefile?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:14.10.3

---------------
update-manager (1:14.10.3) utopic; urgency=low

  [ Mitsuya Shibata ]
  * lp:~cosmos-door/ubuntu/trusty/update-manager/fix1358229:
    - ensure all scripts are treated as python by gettext
      LP: #1358229
 -- Michael Vogt <email address hidden> Mon, 18 Aug 2014 13:36:51 +0200

Changed in update-manager (Ubuntu):
status: New → Fix Released
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.