Re: Translation of plural string in English with spaces

2022-01-06 Thread Luciano Montanaro
It looks like the goal is to have two distinct sets, so that would not work.

On Thu, Jan 6, 2022 at 10:55 AM Josep M. Ferrer  wrote:
>
> El 5/1/22 a les 21:07, Johnny Jazeix ha escrit:
> > 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
>
> Hi,
>
> Instead "boys" and "girls", can we use a more neutral gender like
> "kids"? And then this problem is gone :)
>
> Best regards,
>
> Josep M. Ferrer
>


-- 
Luciano Montanaro

Anyone who is capable of getting themselves made President should on
no account be allowed to do the job. -- Douglas Adams


Re: Translation of plural string in English with spaces

2022-01-06 Thread Johnny Jazeix
Hi,
yes, the aim is to have 2 distinct sets for the pedagogical point of view,
it's a bit more complicated.

Johnny

Le jeu. 6 janv. 2022 à 12:37, Luciano Montanaro  a
écrit :

> It looks like the goal is to have two distinct sets, so that would not
> work.
>
> On Thu, Jan 6, 2022 at 10:55 AM Josep M. Ferrer 
> wrote:
> >
> > El 5/1/22 a les 21:07, Johnny Jazeix ha escrit:
> > > 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
> >
> > Hi,
> >
> > Instead "boys" and "girls", can we use a more neutral gender like
> > "kids"? And then this problem is gone :)
> >
> > Best regards,
> >
> > Josep M. Ferrer
> >
>
>
> --
> Luciano Montanaro
>
> Anyone who is capable of getting themselves made President should on
> no account be allowed to do the job. -- Douglas Adams
>


Re: Translation of plural string in English with spaces

2022-01-05 Thread Albert Astals Cid
El dimecres, 5 de gener de 2022, a les 21:07:34 (CET), Johnny Jazeix va 
escriure:
> 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.

As you've found the current tooling we use to autofill the en.po files from the 
comments doesn't allow spaces at the end, and that "can't be fixed" since it 
means a change in lupdate from qt.

The typical way to solve this kind of puzzles is to translate the 3 strings 
separately and then have a qsTr("%1 %2. %3") [with lots of context] to merge it 
all together and potentially give the translation teams that need some extra 
possibility of repositioning things if they need to.

Cheers,
  Albert

> 
> Cheers,
> 
> Johnny
> 






Translation of plural string in English with spaces

2022-01-05 Thread Johnny Jazeix
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