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

Game development with Board Game Arena Studio
User avatar
RicardoRix
Posts: 1134
Joined: 29 April 2012, 23:43

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

Post by RicardoRix » 21 November 2020, 23:57

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.
Last edited by RicardoRix on 22 November 2020, 00:15, edited 1 time in total.

User avatar
Tisaac
Posts: 370
Joined: 26 August 2014, 21:28

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

Post by Tisaac » 22 November 2020, 00:10

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.

User avatar
RicardoRix
Posts: 1134
Joined: 29 April 2012, 23:43

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

Post by RicardoRix » 22 November 2020, 01:10

or just send multiple 'log' notifications over.

User avatar
MikeIsHere
Posts: 110
Joined: 30 April 2020, 22:52

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

Post by MikeIsHere » 22 November 2020, 17:39

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

Post Reply

Return to “Developers”