[glotpress-updates] [GlotPress] #234: PO exporter should not export empty plurals
GlotPress
noreply at wordpress.org
Wed Mar 13 12:22:53 UTC 2013
#234: PO exporter should not export empty plurals
-----------------------+-----------------
Reporter: dllh | Owner:
Type: defect | Status: new
Priority: major | Milestone:
Component: general | Version:
Keywords: has-patch |
-----------------------+-----------------
Repro:
1. Save a translation with an empty plural.
2. Export
This can cause a .po file to have entries like the following:
{{{
msgid "A GlotPress"
msgid_plural "Many GlotPresses"
msgstr[0] "A GlotPress"
msgstr[1] ""
}}}
When displayed, the string will display blank rather than defaulting to
the untranslated string because {{{translate_plural()}}} does an
{{{isset()}}} check rather than a {{{! empty()}}} check. One solution
would be to change the type of check in {{{translate_plural()}}}.
I wonder if the better solution isn't simply to avoid saving the plural
translation to the .po file if it's empty. I've attached a patch that does
so. I believe this patch will cause the {{{isset()}}} check in
{{{translate_plural()}}} to fail and will thus result in display of the
untranslated plural form, which seems better than just not displaying a
string at all.
--
Ticket URL: <http://glotpress.trac.wordpress.org/ticket/234>
GlotPress <http://glotpress.trac.wordpress.org>
Easy comin', easy goin'
More information about the glotpress-updates
mailing list