MichaelChirico / potools

Tools for working with translations in R
https://michaelchirico.github.io/potools/
58 stars 3 forks source link

get_po_messages should be robust to "corrupted" plural specification #293

Open MichaelChirico opened 2 years ago

MichaelChirico commented 2 years ago

Currently, the R-tr.po file is "corrupted" -- nplural=1; plural=0 for Turkish, but many (empty) msgstr[1] entries exist, e.g.:

https://github.com/r-devel/r-svn/blob/b7d9620c65e1924553c2e270f464cf185fb02ab4/src/library/base/po/R-tr.po#L1763-L1766

Apparently this doesn't trip up the rest of gettext as that msgstr[1] is just ignored; get_po_messages() should do the same.