Translation of plural string in English with spaces

Johnny Jazeix jazeix at gmail.com
Wed Jan 5 20:07:34 GMT 2022


Hi,

for GCompris we have one complicated sentence to translate:
"Place %n boy(s) and %n girl(s) in the center. Then split %n pieces of
candy equally between them." (context in this image:
https://gcompris.net/screenshots_qt/middle/share.png)

There are mixed plurals and to have the plural correctly translated we use:
        //~ singular Place %n boy
        //~ plural Place %n boys
        text = qsTr("Place %n boy(s) ", "First part of Place %n boy(s) and
%n girl(s) in the center. Then split %n pieces of candy equally between
them.", boys);

        //~ singular and %n girl in the center.
        //~ plural and %n girls in the center.
        text += qsTr("and %n girl(s) in the center. ", "Second part of
Place %n boy(s) and %n girl(s) in the center. Then split %n pieces of candy
equally between them.", girls);

        //~ singular Then split %n candy equally between them.
        //~ plural Then split %n candies equally between them.
        text += qsTr("Then split %n pieces of candy equally between them.",
"Third part of Place %n boy(s) and %n girl(s) in the center. Then split %n
pieces of candy equally between them.", candies);

For American English, it takes the string from the " //~ singular/plural "
lines.
The issue we have is that we don't manage to have the extra space in the
English translation at the end of "boy(s) " (same if we put the space at
the beginning of the other part to translate (" and %n girl(s))").

If we add double quotes, they are part of the translation. And if we have
an extra space at the end, it is removed.

Is there a way to handle it properly in the code or even reformulate the
sentence to make it work more easily while keeping the meaning?

I'm cc-ing multiple list because, in the ideal, we'd like to fix the code
without impacting the string for the next release but we can have a better
string for after.

Cheers,

Johnny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/gcompris-devel/attachments/20220105/6fe10cce/attachment.htm>


More information about the GCompris-devel mailing list