[Bug 1358229] [NEW] Set --language=python for XGETTEXT_ARGS in po/Makefile

Mitsuya Shibata mty.shibata at gmail.com
Mon Aug 18 10:28:14 UTC 2014


Public bug reported:

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?

** Affects: update-manager (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1358229

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

Status in “update-manager” package in Ubuntu:
  New

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?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1358229/+subscriptions



More information about the foundations-bugs mailing list