Re: [poedit-users] Plural detection fail
Vaclav Slavik <[email protected]> Sun, 30 May 2010 11:20:14 +0200
| Newsgroups | gmane.editors.poedit.user |
|---|---|
| Message-ID | <1275211214.18383.6.camel@localhost> |
--===============4257569622370545446==
Content-Type: multipart/signed; micalg="pgp-sha1";
protocol="application/pgp-signature";
boundary="=-RmK3BvX83QP7hgaQcVRf"
--=-RmK3BvX83QP7hgaQcVRf
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Sat, 2010-05-29 at 19:55 +0000, MASSUCHETTI Jonathan wrote:
> As you see, my plural is ignored. Why and how to fix ?=20
You need to specify the plural form keyword correctly, as xgettext wants
it:
=E2=80=98-k[keywordspec]=E2=80=99
=E2=80=98--keyword[=3Dkeywordspec]=E2=80=99
Specify keywordspec as an additional keyword to be looked for.
Without a keywordspec, the option means to not use default
keywords.=20
=20
If keywordspec is a C identifier id, xgettext looks for strings
in the first argument of each call to the function or macro id.
If keywordspec is of the form =E2=80=98id:argnum=E2=80=99, xgettext=
looks for
strings in the argnumth argument of the call. If keywordspec is
of the form =E2=80=98id:argnum1,argnum2=E2=80=99, xgettext looks fo=
r strings in
the argnum1st argument and in the argnum2nd argument of the
call, and treats them as singular/plural variants for a message
with plural handling. Also, if keywordspec is of the form
=E2=80=98id:contextargnumc,argnum=E2=80=99 or =E2=80=98id:argnum,co=
ntextargnumc=E2=80=99,
xgettext treats strings in the contextargnumth argument as a
context specifier. And, as a special-purpose support for GNOME,
if keywordspec is of the form =E2=80=98id:argnumg=E2=80=99, xgettex=
t recognizes
the argnumth argument as a string with context, using the GNOME
glib syntax =E2=80=98"msgctxt|msgid"=E2=80=99.=20
Furthermore, if keywordspec is of the form
=E2=80=98id:...,totalnumargst=E2=80=99, xgettext recognizes this ar=
gument
specification only if the number of actual arguments is equal to
totalnumargs. This is useful for disambiguating overloaded
function calls in C++.=20
Finally, if keywordspec is of the form
=E2=80=98id:argnum...,"xcomment"=E2=80=99, xgettext, when extractin=
g a message
from the specified argument strings, adds an extracted comment
xcomment to the message. Note that when used through a normal
shell command line, the double-quotes around the xcomment need
to be escaped.=20
=20
This option has an effect with most languages, namely C, C++,
ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Java, C#,
awk, Tcl, Perl, PHP, GCC-source, Glade.=20
=20
The default keyword specifications, which are always looked for
if not explicitly disabled, are language dependent. They are:=20
=20
* For C, C++, and GCC-source: gettext, dgettext:2,
dcgettext:2, ngettext:1,2, dngettext:2,3,
dcngettext:2,3, gettext_noop, and pgettext:1c,2,
dpgettext:2c,3, dcpgettext:2c,3, npgettext:1c,2,3,
dnpgettext:2c,3,4, dcnpgettext:2c,3,4.=20
* For Objective C: Like for C, and also NSLocalizedString,
_, NSLocalizedStaticString, __.=20
* For Shell scripts: gettext, ngettext:1,2, eval_gettext,
eval_ngettext:1,2.=20
* For Python: gettext, ugettext, dgettext:2, ngettext:1,2,
ungettext:1,2, dngettext:2,3, _.=20
* For Lisp: gettext, ngettext:1,2, gettext-noop.=20
* For EmacsLisp: _.=20
* For librep: _.=20
* For Scheme: gettext, ngettext:1,2, gettext-noop.=20
* For Java: GettextResource.gettext:2,
GettextResource.ngettext:2,3,
GettextResource.pgettext:2c,3,
GettextResource.npgettext:2c,3,4, gettext, ngettext:1,2,
pgettext:1c,2, npgettext:1c,2,3, getString.=20
* For C#: GetString, GetPluralString:1,2,
GetParticularString:1c,2,
GetParticularPluralString:1c,2,3.=20
* For awk: dcgettext, dcngettext:1,2.=20
* For Tcl: ::msgcat::mc.=20
* For Perl: gettext, %gettext, $gettext, dgettext:2,
dcgettext:2, ngettext:1,2, dngettext:2,3,
dcngettext:2,3, gettext_noop.=20
* For PHP: _, gettext, dgettext:2, dcgettext:2,
ngettext:1,2, dngettext:2,3, dcngettext:2,3.=20
* For Glade 1: label, title, text, format, copyright,
comments, preview_text, tooltip.=20
=20
To disable the default keyword specifications, the option =E2=80=98=
-k=E2=80=99
or =E2=80=98--keyword=E2=80=99 or =E2=80=98--keyword=3D=E2=80=99, w=
ithout a keywordspec, can be
used.=20
IOW, just "plural" is not enough for plural forms, you need to add ':'
and argnum(s) to it.
Regards,
Vaclav
--=-RmK3BvX83QP7hgaQcVRf
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
iEYEABECAAYFAkwCLc4ACgkQxDYa/UZSZMnbvwCeMfeRnOJW2+8ya+XF+2goh4rL
FzYAn0SXZaw00/L3YW7AIo9rTQbIah76
=jIuW
-----END PGP SIGNATURE-----
--=-RmK3BvX83QP7hgaQcVRf--
--===============4257569622370545446==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
--===============4257569622370545446==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Poedit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/poedit-users
--===============4257569622370545446==--