Page 1 of 1
Missing translation bug
Posted: 12 January 2021, 11:59
by RicardoRix
I have a bug report:
https://boardgamearena.com/bug?id=31741
but I am not responsible for translations, why are these bug reports directed to the developer?
Re: Missing translation bug
Posted: 12 January 2021, 12:27
by XCID
For non-devs it's hard to determine wether a bug is game or bga framework related.
In this case, the translation exists, but still the english text is displayed. So it might be an actual game related problem.
Re: Missing translation bug
Posted: 12 January 2021, 12:55
by RicardoRix
OK, I think it's down to the way I am handling the message.
This was my first ever game so I don't why I didn't use an argument like ${number}
Code: Select all
self::notifyPlayer($player_id, 'error', '', array(
'message' => clienttranslate('You must play cards the same rank or higher as the last card played ({0}), or a 2'),
'args' => array($this->values_label[$currentFaceValue])));
Code: Select all
notif_error: function( notif )
{
var formatted = notif.args.message;
for( var arg in notif.args.args ) {
formatted = formatted.replace("{" + arg + "}", notif.args.args[arg]);
}
this.showMessage( formatted, 'error' );
this.unselectAll();
},
You must play cards the same rank or higher as the last card played ({0}), or a 2
Du musst Karten mit dem gleichen Wert oder höher als die letzte Karte ({0}) spielen, oder eine 2
Is there any way I can fix this without breaking the original translations?
why is notif.args.message not translated?
Re: Missing translation bug
Posted: 12 January 2021, 13:44
by Tisaac
You should read again how translation works.
Short answer :
Code: Select all
notif_error: function( notif )
{
var formatted = _(notif.args.message);
...
},
Re: Missing translation bug
Posted: 12 January 2021, 14:20
by RicardoRix
Using the << >> in the studio:
I have 2 different messages:
This is translated but does not go through the JS notif_error() function.
self::notifyPlayer($player_id, 'error', '', array('message' => clienttranslate('You must select atleast 1 card')));
result:
«You must select atleast 1 card»
This is NOT translated and does go through the JS notif_error() function.
self::notifyPlayer($player_id, 'error', '', array('message' => clienttranslate('No cards to pick up')));
result:
No cards to pick up
Re: Missing translation bug
Posted: 12 January 2021, 14:45
by Tisaac
RicardoRix wrote: ↑12 January 2021, 14:20
This is translated but does not go through the JS notif_error() function.
self::notifyPlayer($player_id, 'error', '', array('message' => clienttranslate('You must select atleast 1 card')));
result:
«You must select atleast 1 card»
When you say 'result', where is it displayed ?
Re: Missing translation bug
Posted: 12 January 2021, 15:09
by RicardoRix
Tisaac wrote: ↑12 January 2021, 14:45
When you say 'result', where is it displayed ?
oopsie => I have this message in the JS aswell
Thanks for your help.