Skip Menu |
 

This queue is for tickets about the libintl-perl CPAN distribution.

Report information
The Basics
Id: 40695
Status: resolved
Priority: 0/
Queue: libintl-perl

People
Owner: Nobody in particular
Requestors: unrtst [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.16
Fixed in: (no value)



Subject: Missing support for msgctxt. Added in attached patch.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1225920937-5580-3"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 1465
Download (untitled) / with headers
text/plain 1.4k
I've created a patch to add support for msgctxt in .po files, and the corrosponding gettext calls pgettext, npgettext, and their d/dc friends. Docs, tests, etc have all been created/updated. The patch should apply cleanly to 1.16 of libintl-perl. I've also included a patched tarball, and called it 1.17. The new calls have been reimplemented in the gettext_xs.xs and gettext_pp.pm files, so the underlying libc libraries need not support the new calls (first added in 2006 to gettext-0.15). However, the included .po files in the tests/ directory need to be compiled with a recent gettext (version >= 0.15) as the older msgfmt will die when it sees the new "msgctxt" entries. This shouldn't effect normal users, as those are distributed pre-compiled. In Locale::TextDomain, the new calls are wrapped as __p, __np, __px, and __npx. The "p" is what GNU Gettext used, and refers to "particular", as in, this particular case... I'm guessing because the "c" was already used for the "category". The plural support is handled in Locale::TextDomain, the context isn't really useful on plurals, but on singulars, it's still very useful, for example: __p("Verb, to view", "View"); The word "View" gets translated, but this way, you can have a separate translation for the verb and for the noun. Please consider this patch for inclusion in the next release of libintl-perl, and let me know if there anyone finds any bugs/problems/issues with the new code. Thank you,
Subject: libintl-perl-1.16.patch
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1225920937-5580-2"
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: text/x-patch; name="libintl-perl-1.16.patch"
Content-Disposition: inline; filename="libintl-perl-1.16.patch"
Content-Transfer-Encoding: binary
Content-Length: 73112

Message body is not shown because it is too large.

MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-19052-1243264097-1386.40695-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 27
Added in libintl-perl 1.17.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.