Missing translation bug

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

Missing translation bug

Post 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?
User avatar
XCID
Posts: 78
Joined: 26 March 2020, 01:45

Re: Missing translation bug

Post 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.
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: Missing translation bug

Post 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?
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: Missing translation bug

Post by Tisaac »

You should read again how translation works.
Short answer :

Code: Select all

notif_error: function( notif )
        {
			var formatted = _(notif.args.message);
			...
		},	
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: Missing translation bug

Post 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
Last edited by RicardoRix on 12 January 2021, 14:54, edited 1 time in total.
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: Missing translation bug

Post 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 ?
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: Missing translation bug

Post 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 :oops:

Thanks for your help.
Post Reply

Return to “Developers”