Page 1 of 1

[SOLVED] translation for dynamic state description

Posted: 21 July 2020, 17:14
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

Re: translation for dynamic state description

Posted: 21 July 2020, 20:20
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)

Re: [SOLVED] translation for dynamic state description

Posted: 22 July 2020, 04:00
by hersh
works!

thanks