Package: gettext
Version: 0.18.1.1-9
Severity: normal

Hello!
Thanks for maintaining gettext in Debian!


I noticed that xgettext does not properly replace all the relevant
placeholders in the output .pot file, when told to do so through
command-line options.

I'll try to explain the issues with a minimal test case.

Let's consider the example in the official Python library reference [1].
This should be minimal enough, I think.

[1] http://docs.python.org/library/gettext.html#module-gettext

Here's the example code:

  $ cat myapplication.py 
  import gettext
  gettext.bindtextdomain('myapplication', '/path/to/my/language/directory')
  gettext.textdomain('myapplication')
  _ = gettext.gettext
  # ...
  print _('This is a translatable string.')

Let's generate the corresponding .pot file:

  $ xgettext --language=python myapplication.py -o myapplication.pot
  $ cat myapplication.pot 
  # SOME DESCRIPTIVE TITLE.
  # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
  # This file is distributed under the same license as the PACKAGE package.
  # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
  #
  #, fuzzy
  msgid ""
  msgstr ""
  "Project-Id-Version: PACKAGE VERSION\n"
  "Report-Msgid-Bugs-To: \n"
  "POT-Creation-Date: 2012-07-23 22:49+0200\n"
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  "Language-Team: LANGUAGE <l...@li.org>\n"
  "Language: \n"
  "MIME-Version: 1.0\n"
  "Content-Type: text/plain; charset=CHARSET\n"
  "Content-Transfer-Encoding: 8bit\n"

  #: myapplication.py:6
  msgid "This is a translatable string."
  msgstr ""

This seems to be OK, but some placeholders should be replaced by actual
values.
It is my understanding that (before the .pot file is made available to
prospective translators who wish to start a localization in a new
language) the second line should be replaced by appropriate copyright
notices, and that PACKAGE and VERSION should be replaced by the actual
package name and version number.
Let's try with the following command-line options:

  $ xgettext --copyright-holder="Python Software Foundation" \
             --package-name=myapplication --package-version=0.1 \
             --language=python myapplication.py -o myapplication2.pot
  $ cat myapplication2.pot 
  # SOME DESCRIPTIVE TITLE.
  # Copyright (C) YEAR Python Software Foundation
  # This file is distributed under the same license as the PACKAGE package.
  # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
  #
  #, fuzzy
  msgid ""
  msgstr ""
  "Project-Id-Version: myapplication 0.1\n"
  "Report-Msgid-Bugs-To: \n"
  "POT-Creation-Date: 2012-07-23 22:49+0200\n"
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  "Language-Team: LANGUAGE <l...@li.org>\n"
  "Language: \n"
  "MIME-Version: 1.0\n"
  "Content-Type: text/plain; charset=CHARSET\n"
  "Content-Transfer-Encoding: 8bit\n"

  #: myapplication.py:6
  msgid "This is a translatable string."
  msgstr ""
  $ diff myapplication.pot myapplication2.pot 
  2c2
  < # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
  ---
  > # Copyright (C) YEAR Python Software Foundation
  9c9
  < "Project-Id-Version: PACKAGE VERSION\n"
  ---
  > "Project-Id-Version: myapplication 0.1\n"

That's better, but there are a few issues left:

 (A) first of all, the YEAR placeholder in the second line is not
     replaced, and I failed to find an option to do so

 (B) secondly, I cannot find a way to include multi-line copyright
     notices, as in [2]:

     # Copyright (C) 2001-2012 Python Software Foundation.
     # Copyright (C) 2000 BeOpen.com.
     # Copyright (C) 1995-2000 Corporation for National Research Initiatives.
     # Copyright (C) 1991-1995 Stichting Mathematisch Centrum.

[2] http://docs.python.org/copyright.html

 (C) finally, the PACKAGE placeholder is correctly replaced in the
     Project-Id-Version field, but left untouched in the third line of
     myapplication2.pot


Please fix these issues and/or forward this bug report upstream,
as appropriate.

Thanks for your time!



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (800, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gettext depends on:
ii  dpkg            1.16.4.3
ii  gettext-base    0.18.1.1-9
ii  install-info    4.13a.dfsg.1-10
ii  libasprintf0c2  0.18.1.1-9
ii  libc6           2.13-33
ii  libcroco3       0.6.5-1
ii  libgettextpo0   0.18.1.1-9
ii  libglib2.0-0    2.32.3-1
ii  libgomp1        4.7.1-2
ii  libncurses5     5.9-10
ii  libtinfo5       5.9-10
ii  libunistring0   0.9.3-5
ii  libxml2         2.8.0+dfsg1-4

Versions of packages gettext recommends:
ii  autopoint  0.18.1.1-9
ii  curl       7.26.0-1
ii  wget       1.13.4-3

Versions of packages gettext suggests:
pn  gettext-doc  <none>

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to