Subject: | Missing support for msgctxt. Added in attached patch. |
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 |
Message body is not shown because it is too large.