[PATCH 2/2] Fix plurals translation

Dirk Hohndel dirk at hohndel.org
Fri Oct 30 07:28:24 PDT 2015


On Thu, Oct 29, 2015 at 10:18:14PM +0100, Jan Mulder wrote:
> On 29-10-15 20:33, Dirk Hohndel wrote:
> >On Thu, Oct 29, 2015 at 12:17:05PM -0700, Dirk Hohndel wrote:
> >
> >     <message numerus="yes">
> >         <location filename="../qthelper.cpp" line="1077"/>
> >         <source>(%n dive(s))</source>
> >         <translation type="unfinished">
> >             <numerusform></numerusform>
> >         </translation>
> >     </message>
> >
> >and clearly transifex does not like this. Some googling seems to imply
> >that transifex is aware of the bug and promised a fix more than a year ago
> >(and then instead just shut down their forums - nice). But I also found a
> >workaround and it appears to do the trick. Now I just need to remember to
> >manually fix our .ts file before I send it - or somehow automate the
> >workaround (which is to duplicate the "<numerusform></numerusform>" line)
> 
> I'm not realy sure what you mean here with "workaround". I just translated
> Dutch, and the example above results in the following .ts fragment:

The workaround is what I need to do before pushing to transifex. If I just
run the tools and push then there is only one <numerusform></numerusform>
entry in subsurface_source.ts and transifex stumbles over that. But if I
manually duplicate that one line then things appear to work as expected
(and the translators don't need to worry about anything).

> with (after applying Sergey's patch 2/2) results exactly in the desired
> behaviour: 1 dive, 2 dives.

And it also works for the languages with more forms (like Russian, which
is why Sergey sent this to begin with).

> The only thing I do not like is that Transiflex warns about different number
> of parenthesis between original and translation.

As Sergey points out that's just Transifex not paying attention. That is
actually the expected thing to happen because we have the (s) in English
but of course not in the other languages.

/D


More information about the subsurface mailing list