GNOME Bugzilla – Bug 123528
Plural forms handling
Last modified: 2009-02-01 11:52:59 UTC
Plural forms support is lacking in a few areas. The main issue is the handling of the 'Plural-Forms' header. Other issues are related to usability of the gtranslator implementation, as noted by epiotr@use.pl.
Link to thread on mailing list containing Piotr's original report: http://sourceforge.net/mailarchive/forum.php?thread_id=3208380&forum_id=5924 I will attempt to add plurals to gtranslator in a few places, so we are familiar with these issues when translating gtranslator itself. I would also change the status of this bug to ASSIGNED, but bugzilla seems to be a bit confused atm.
KBabel issues warning when opening file with plural forms. It's good if gtranslator also warns users until plural forms are handled.
There is work going on in the 'gettext-hack' branch of CVS. This branch does away with the current PO file parsing/writing code, and instead uses the gettext library directly. Internally, all the GtrMsg structures now have pointers to a gettext-style 'message_ty' struct, instead of members for the various attributes. The GUI has been updated to display the english text and translation window in however many GtkTextViews are required to display and edit a plural forms message, packed into two GtkVBoxes (one for text, one for trans). It works, in that I can now open a PO file with plurals, view and translate any plural messages and save the file successfully. As it relies on a slightly hacked 'gettext' (patch has been submitted upstream), and has undergone fairly extensive surgery, there will now be a period whereby I tie up all the main arteries to prevent segfaults and wait for the patch to be integrated upstream and a new official gettext released with the required patches. Then, I will roll it all back into HEAD and we can start making releases based on it. The gettext patch (http://www.golder.org/~rossg/pub/gtranslator/gettext-CVS-error-handling-20040812.patch) is against gettext CVS (http://sources.redhat.com/gettext/). As at now, I still have to purge all the 'error(_at_line)' and 'abort' calls from gettext write_po.c and friends, as errors writing the PO file will inadvertently terminate the gtranslator process :)
Progress update - Bruno Haible (gettext author/maintainer) has created a pre-release of gettext-0.15, including an updated API (in gettext-po.h) that allows us to read, modify and write po files. CVS HEAD now makes use of this new API. Read the INSTALL.CVS file. However, at time of writing, I still haven't resolved some issues with the GUI, so CVS HEAD still needs some love.
Any progress on this?
I've just reviewed a patch that was submitted. It basically works, but it needs more love before it can be committed to the stable branch. I'll try to get it attached to this bug report shortly, so more it gets some more exposure.
Can you attach the patch?
Created attachment 52423 [details] [review] Vital Khilko's 1.1 patch for plurals I recall having a few issues getting it to apply, and subsequently to compile. YMMV.
Well i think now in svn version it is working more or less like in kbabel. Missing some things: * Page_Down should change to next plural form if there are plurals. * If i change to translate plural tab should change the original text plural tab. Anything else?
Created attachment 107104 [details] [review] plural patch This should fix this bug. It needs some improvements like a shortcut to change between plural tabs. But first we need to decide the shortcut we should use.
please note that plural support in nacho's git branch works flawless for me.
This was fixed by me some time ago, so I think this can be closed.