Page 3 of 3

Re: Translation on server side based on current player, not client?

Posted: 21 November 2020, 23:57
by RicardoRix
no, ditch the sprintf's they are just not helping you.

Use ${points} instead.

You can't manipulate the clienttranslate() with the implode (this in not a standard string array you have created), I would try to pass the array over as a whole (not sure if that works), or you may have to go with 'string1', 'string2', etc and leave them blank if and when they are not used.

Re: Translation on server side based on current player, not client?

Posted: 22 November 2020, 00:10
by Tisaac
If you are using another translatable string as the glue for the sprintf, there is no reasons it won't work.
But I agree that the less sprintf, the better.

Re: Translation on server side based on current player, not client?

Posted: 22 November 2020, 01:10
by RicardoRix
or just send multiple 'log' notifications over.

Re: Translation on server side based on current player, not client?

Posted: 22 November 2020, 17:39
by MikeIsHere
Thank you, all great advice
no, ditch the sprintf's they are just not helping you.
Use ${points} instead.
In the current setup I cannot because the ${points} variable accumulates, and I don't know how many different type of scores I will have.

If you are using another translatable string as the glue for the sprintf, there is no reasons it won't work.
Not quite sure I follow, the string is

Code: Select all

"fifteen_hand" => clienttranslate('15 for %s  '),
and then

Code: Select all

$scoringDetail[] = sprintf($this->translations["fifteen_hand"], $points) . $cardString;
You can't manipulate the clienttranslate() with the implode (this in not a standard string array you have created),
Not sure if that works either if I remember hence the implode to create one string
You should never use a concatenation in a translatable string !
The only thing I am concatenating is the cards themselves, so that should not be a translation issue, right?
or just send multiple 'log' notifications over.
I am trying to avoid this as there was a warning somewhere not to overload the logs, and entering a game with a long history is slow as it is