[SOLVED] translation for dynamic state description

Game development with Board Game Arena Studio
Post Reply
User avatar
hersh
Posts: 76
Joined: 12 December 2013, 23:49

[SOLVED] translation for dynamic state description

Post by hersh »

trying to figure out the best approach to fix a translation bug . for a particular state I use a dynamic description which is populated via arg

Code: Select all

return array(
  description => clienttranslate("dynamic description")
)

Code: Select all

in my state I have the following:
        "description" => '${actplayer} ${description}',
        "descriptionmyturn" => '${you} ${description}',
but it does not translate to other languages because the string is not an exact match. if I change description to clienttranslate('${you} dynamic description') then ${you} is not substituted.

how can I accomplish both? any ideas?

thanks
Last edited by hersh on 22 July 2020, 04:00, edited 1 time in total.
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: translation for dynamic state description

Post by Tisaac »

How dynamic is your description ? Is it just 2/3 different cases or a bunch ?
If it is only a couple, for instance «you must/may ...», the easiest way would be to add field to your state : 'descriptionmyturnskippable' => '{$you} May...'
And then on the js side you can change the page title with some undocumented function (search for updatePageTitle on the forum)
User avatar
hersh
Posts: 76
Joined: 12 December 2013, 23:49

Re: [SOLVED] translation for dynamic state description

Post by hersh »

works!

thanks
Post Reply

Return to “Developers”