In thurn and taxis have some states like this:
mustmay = must / may
second = second / ''
This way, translating makes problems for many languages.
In the docs I have seen something like:
But I am not sure, if here the ${you} won't be translated with the dojo.string.substitute method. Which client-method is used internally for the state-descriptions for translating. Also for highlighting the ${player_name} field? Or do I have to do it manually with inserting some <span style="color..?
Code: Select all
STATE_ADD_CITY_CARD => array(
"name" => "addCityCard",
"description" => clienttranslate('${actplayer} ${mustmay} add a ${second} city card to their hand'),
"descriptionmyturn" => clienttranslate('${you} ${mustmay} add a ${second} city card to your hand'),
"type" => "activeplayer",
"args" => "argAddCityCard",
"possibleactions" => array("getCard", "replaceCityCards", "pass"),
"transitions" => array("playCard" => STATE_PLAY_CITY_CARD, "getSecondCard" => STATE_ADD_CITY_CARD, "replaceCityCards" => STATE_ADD_CITY_CARD),
),
second = second / ''
This way, translating makes problems for many languages.
In the docs I have seen something like:
Code: Select all
if (args.args.mustmay == 'must')
if (args.args.second)
this.gamedatas.gamestate.descriptionmyturn = _('${you} must add a second city card to your hand');
else
this.gamedatas.gamestate.descriptionmyturn = _('${you} must add a city card to your hand');
else
if (args.args.second)
this.gamedatas.gamestate.descriptionmyturn = _('${you} may add a second city card to your hand');
else
this.gamedatas.gamestate.descriptionmyturn = _('${you} may add a city card to your hand');
this.gamedatas.gamestate.descriptionmyturn = dojo.string.substitute(this.gamedatas.gamestate.descriptionmyturn, args.args);
this.updatePageTitle();