Re: Plural forms in translations



Le vendredi 07 mars 2008 à 16:14 +0530, Runa Bhattacharjee a écrit :
> Claude Paroz wrote:
> > Le vendredi 07 mars 2008 à 15:15 +0530, Runa Bhattacharjee a écrit :
> >   
> >> Hi Claude,
> >>
> >> Claude Paroz wrote:
> >>     
> >>> Hi all,
> >>>
> >>> I noticed today that several translations (especially Marathi, Bengali,
> >>> Hindi, Indonesian and others) have problems because of the plural form. 
> >>> See e.g. http://l10n.gnome.org/languages/mr/gnome-2-22
> >>>
> >>> Please, do not commit translations into GNOME SVN without checking first
> >>> that they pass 'msgfmt' check command:
> >>>
> >>> msgfmt -vvc -o /dev/null mr.po
> >>>
> >>> When there is a plural string, like this:
> >>>
> >>> msgid "There is a tab with errors"
> >>> msgid_plural "There are %d tabs with errors"
> >>>
> >>> You have to add the %d format string in your translation (if it is
> >>> present in the original string). At runtime, %d will be replaced by a
> >>> real number.
> >>>
> >>> Please, correct the files as soon as possible.
> >>>
> >>>
> >>>   
> >>>       
> >> Thanks for bringing this up. I have been updating the bn_IN.po files the 
> >> past week after passing it with msgfmt, but none of the files show an 
> >> errors:
> >>
> >> [runab runab file-roller]$ msgfmt -cv -o /dev/null bn_IN.po 
> >> 259 translated messages.
> >>     
> >
> > Weird.
> > $ msgfmt -vvc -o /dev/null bn_IN.po 
> > bn_IN.po:124: number of format specifications in 'msgid' and 'msgstr[1]'
> > does not match
> > msgfmt: found 1 fatal error
> > 259 translated messages.
> >
> > $ msgfmt --version
> > msgfmt (GNU gettext-tools) 0.16.1
> >
> > In the particular case of file-roller bn_IN.po, the problem is that
> > msgstr[1] (translated plural form) is empty at line 125.
> >
> >
> >   
> Yup, got it now. The msgfmt version I was using is this:
> $ msgfmt --version
> msgfmt (GNU gettext-tools) 0.14.6
> 
> The above error is thrown on my local file with the 0.16.1 version.
> 
> In any case, for languages which do not have a plural form, the problem 
> might still persist in case the editor settings are set to "not require 
> the plural forms". I get the following screen with only one placeholder 
> for the msgstr string. [1]

Language with no plural form should use the string "Plural-Forms:
nplurals=1; plural=0;" (1) and not tweak the po editor.
Is it the case with your language?

(1)
http://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html

Claude



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]