Page 1 of 1

[Last Droids]Translations are not applied to the log

Posted: 02 December 2025, 14:46
by JudgeWhyMe
Hello

In that game, the log on the right side is not translated, and I don't know why
Image

What I do:
$prompt = clienttranslate("Message to be displayed {var}");
$prompt = str_replace("{var}", var_value, $prompt);
$this->notify->all("message", strval($prompt ), [] );

Am I doing something wrong?

I checked in translation HQ, the strings that are in the log appears there and are translated
Image

Thanks

Re: [Last Droids]Translations are not applied to the log

Posted: 02 December 2025, 19:13
by Thomas
This is the forum for translations, not for development, maybe you ask your question at https://boardgamearena.com/forum/viewforum.php?f=12 to reach experienced developers.

I have no experience with BGA development, but I found an example for translating texts with variables. Maybe that helps:

clienttranslate_('First part of the string, ${argument} second part of the string'), ['argument' => $argument ]

See https://en.doc.boardgamearena.com/Translations for more details on developing and translation.

Re: [Last Droids]Translations are not applied to the log

Posted: 03 December 2025, 15:10
by tchobello
JudgeWhyMe wrote: 02 December 2025, 14:46 Hello

In that game, the log on the right side is not translated, and I don't know why

What I do:
$prompt = clienttranslate("Message to be displayed {var}");
$prompt = str_replace("{var}", var_value, $prompt);
$this->notify->all("message", strval($prompt ), [] );

Am I doing something wrong?

I checked in translation HQ, the strings that are in the log appears there and are translated
Image

Thanks
try using $var_value...

Re: [Last Droids]Translations are not applied to the log

Posted: 25 December 2025, 22:50
by Kayvon
Developer here. That's not the correct way to do notification, which is why nothing is being translated.

$name_of_card = clienttranslate('Ace of Spaces');
$this->notify->all("message", strval(clienttranslate('You just played the card ${cardname}'), [
"i18n" => ["cardname"],
"cardname" => $name_of_card,
] );

Of course, it's even simpler if you don't need to translate the argument.

$value = 5;
$this->notify->all("message", strval(clienttranslate('You lose ${num} health'), [
"num" => $value,
] );

---

Instead, you're signalling that $prompt should be translated, but then you're sending a string that's different than $prompt. $prompt is a portion of that string, but it doesn't automatically translate small portions. That would break a lot of stuff.