I have developed a game called Zener and I am trying to resolve a translation bug where the names of the pieces aren't translated in the description from states.inc.php.
I have this in states.inc.php:
Code: Select all
"description" => clienttranslate( '${actplayer} must move ${mandatory_move} piece' ),
"descriptionmyturn" => clienttranslate( '${you} must move ${mandatory_move} piece' ),
Code: Select all
in setupNewGame:
$tmp = clienttranslate( '${actplayer} must move the circle piece' );
$tmp = clienttranslate( '${actplayer} must move the square piece' );
$tmp = clienttranslate( '${actplayer} must move the waves piece' );
$tmp = clienttranslate( '${actplayer} must move the star piece' );
$tmp = clienttranslate( '${actplayer} must move the cross piece' );
$tmp = clienttranslate( '${actplayer} must move any piece' );
$tmp = clienttranslate( '${you} must move the circle piece' );
$tmp = clienttranslate( '${you} must move the square piece' );
$tmp = clienttranslate( '${you} must move the waves piece' );
$tmp = clienttranslate( '${you} must move the star piece' );
$tmp = clienttranslate( '${you} must move the cross piece' );
$tmp = clienttranslate( '${you} must move any piece' );
...
function argsMandatoryChoose()
{
$statement;
$mandatory_move = self::getGameStateValue('mandatory_move');
switch($mandatory_move)
{
case 1:
$statement = clienttranslate( 'the circle' );
break;
case 2:
$statement = clienttranslate( 'the cross' );
break;
case 3:
$statement = clienttranslate( 'the waves' );
break;
case 4:
$statement = clienttranslate( 'the square' );
break;
case 5:
$statement = clienttranslate( 'the star' );
break;
case 0:
default:
$statement = clienttranslate( 'any' );
}
$possible_pieces = self::getPossiblePieces( $mandatory_move );
// we check if the mandatory move can be made in stMandatoryChoose
return array(
'mandatory_move' => $statement,
'possible_pieces' => $possible_pieces
);
}