Question about translation

Game development with Board Game Arena Studio
Post Reply
User avatar
Volker78
Posts: 65
Joined: 29 April 2020, 21:37

Question about translation

Post by Volker78 »

For notifications, is it possible to translate args in arrays recursively? For example:

Code: Select all

		$this->notifyAllPlayers('xxx', clienttranslate('You have the words ${words}'), [
			'i18n' => ['words'],
			'words' => [
				[
					clienttranslate('a'),
					clienttranslate('b'),
				], 
				[
					clienttranslate('c'),
					clienttranslate('d'),
					clienttranslate('e'),
				],
			],
		]);
User avatar
Tisaac
Posts: 2351
Joined: 26 August 2014, 21:28

Re: Question about translation

Post by Tisaac »

What is it supposed to write ? How do you expect an array to be converted to a string in the notif message ?
User avatar
Een
Posts: 3854
Joined: 16 June 2010, 19:52

Re: Question about translation

Post by Een »

Yes, it's possible, there is a quick example about this at the end of http://en.doc.boardgamearena.com/Main_g ... fy_players
Post Reply

Return to “Developers”