[DRE-maint] Bug#684184: closed by Hleb Valoshka <375gnu at gmail.com> (Bug#684184: fixed in ruby-gettext 2.2.1-3)

Francesco Poli invernomuto at paranoici.org
Thu Nov 1 10:23:50 UTC 2012


Control: found -1 ruby-gettext/2.2.1-3


On Sun, 07 Oct 2012 22:21:13 +0000 Debian Bug Tracking System wrote:

[...]
>      - 0005-process-RubyToken-TkDSTRING-too.patch: rgettext won't copy
>        comments for translators to all subsequent messages (Closes: #684184)

Thanks for addressing this issue.
Unfortunately, the fix seems to be incomplete.

I still experience the bug, whenever ngettext() is used.

I updated my little test case (originally sent along with bug
report #684182), in order to show that the bug is not yet completely
fixed.


  $ cat myapplication.rb
  #!/usr/bin/ruby1.8
  # Copyright (C) 2012 Francesco Poli
  #
  #  This program is free software; you can redistribute it and/or modify
  #  it under the terms of the GNU General Public License as published by
  #  the Free Software Foundation; either version 2 of the License, or
  #  (at your option) any later version.
  #
  #  This program is distributed in the hope that it will be useful,
  #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  #  GNU General Public License for more details.
  #
  #  You should have received a copy of the GNU General Public License with
  #  the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
  #  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  #  Suite 330, Boston, MA  02111-1307  USA
  
  require 'gettext'
  include GetText
  GetText::bindtextdomain("myapplication")
  
  count = 0
  print _("Hello everybody!\n")
  count += 1
  
  print _("You are running an internationalized Ruby program.\n")
  count += 1
  
  # TRANSLATORS: %d is the number of already printed messages
  print ngettext("You have already seen %d translatable message.\n",
                 "You have already seen %d translatable messages.\n",
                 count) % count
  
  print _("Is this message # 3 or # 4 ?\n")
  
  print _("OK, I am tired...\n")
  
  print _("Goodbye!\n")


Let's generate the corresponding .pot file by using xgettext (from the
gettext package):

  $ xgettext --add-comments=TRANSLATORS --no-wrap \
             --copyright-holder="Francesco Poli" \
             --package-name=myapplication --package-version=0.2 \
             --msgid-bugs-address="address at example.com" \
             --language=python \
             myapplication.rb -o myapplication_XGETTEXT.pot
  $ cat myapplication_XGETTEXT.pot 
  # SOME DESCRIPTIVE TITLE.
  # Copyright (C) YEAR Francesco Poli
  # This file is distributed under the same license as the PACKAGE package.
  # FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
  #
  #, fuzzy
  msgid ""
  msgstr ""
  "Project-Id-Version: myapplication 0.2\n"
  "Report-Msgid-Bugs-To: address at example.com\n"
  "POT-Creation-Date: 2012-11-01 11:05+0100\n"
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
  "Language-Team: LANGUAGE <LL at li.org>\n"
  "Language: \n"
  "MIME-Version: 1.0\n"
  "Content-Type: text/plain; charset=CHARSET\n"
  "Content-Transfer-Encoding: 8bit\n"
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
  
  #: myapplication.rb:24
  msgid "Hello everybody!\n"
  msgstr ""
  
  #: myapplication.rb:27
  msgid "You are running an internationalized Ruby program.\n"
  msgstr ""
  
  #. TRANSLATORS: %d is the number of already printed messages
  #: myapplication.rb:31
  #, python-format
  msgid "You have already seen %d translatable message.\n"
  msgid_plural "You have already seen %d translatable messages.\n"
  msgstr[0] ""
  msgstr[1] ""
  
  #: myapplication.rb:35
  msgid "Is this message # 3 or # 4 ?\n"
  msgstr ""
  
  #: myapplication.rb:37
  msgid "OK, I am tired...\n"
  msgstr ""
  
  #: myapplication.rb:39
  msgid "Goodbye!\n"
  msgstr ""


Once again, everything seems to be OK.
Let's try with rgettext:

  $ rgettext myapplication.rb -o myapplication_RGETTEXT.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 at ADDRESS>, YEAR.
  #
  #, fuzzy
  msgid ""
  msgstr ""
  "Project-Id-Version: PACKAGE VERSION\n"
  "POT-Creation-Date: 2012-11-01 11:06+0100\n"
  "PO-Revision-Date: 2012-11-01 11:06+0100\n"
  "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
  "Language-Team: LANGUAGE <LL at li.org>\n"
  "MIME-Version: 1.0\n"
  "Content-Type: text/plain; charset=UTF-8\n"
  "Content-Transfer-Encoding: 8bit\n"
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
  
  #: myapplication.rb:24
  msgid "Hello everybody!\n"
  msgstr ""
  
  #: myapplication.rb:27
  msgid "You are running an internationalized Ruby program.\n"
  msgstr ""
  
  #. %d is the number of already printed messages
  #: myapplication.rb:31
  msgid "You have already seen %d translatable message.\n"
  msgid_plural "You have already seen %d translatable messages.\n"
  msgstr[0] ""
  msgstr[1] ""
  
  #. %d is the number of already printed messages
  #: myapplication.rb:35
  msgid "Is this message # 3 or # 4 ?\n"
  msgstr ""
  
  #: myapplication.rb:37
  msgid "OK, I am tired...\n"
  msgstr ""
  
  #: myapplication.rb:39
  msgid "Goodbye!\n"
  msgstr ""


As you can see, rgettext wrongly copies the comment for translators
before the subsequent translatable messages, until one translatable
message not using ngettext() is encountered.
In the present case, this means that the comment is wrongly copied
once.

This should not happen.

Please fix this bug for ngettext() cases too.
Thanks for your time!


-- 
 http://www.inventati.org/frx/frx-gpg-key-transition-2010.txt
 New GnuPG key, see the transition document!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20121101/7c82a0a6/attachment.pgp>


More information about the Pkg-ruby-extras-maintainers mailing list