I thought I would be able to use clienttranslate() within sprintf the way the examples show using _() but that doesn't seem to be the case. Instead I am switching to the i18n argument method shown in the example but I'm not confident in what I am seeing in terms of translation results in studio.
Here's one of the simple code snippets. Based on the card_name example where it says to provide the original English string I didn't add clienttranslate around "moves to" and "stays in" and instead marked them as // NOI18N to address the warning in the project checker. For this one I could presumably just add both full log strings to be translated but there are more complex examples where that wouldn't work and I figured this simple example would help make sure I understand the concept correctly.
$guide_action = "moves to"; // NOI18N
if ($region == $section)
{
$guide_action = "stays in"; // NOI18N
}
$msg = clienttranslate('The ${guide_icon} ${guide_action} region ${region_icon}');
self::notifyAllPlayers( "placeGuide", $msg , array(
'i18n' => array ( 'guide_action' ),
'guide_action' => $guide_action,
'region' => $section,
'region_icon' => $section,
'guide_icon' => 'guide'
) );
Here's one of the simple code snippets. Based on the card_name example where it says to provide the original English string I didn't add clienttranslate around "moves to" and "stays in" and instead marked them as // NOI18N to address the warning in the project checker. For this one I could presumably just add both full log strings to be translated but there are more complex examples where that wouldn't work and I figured this simple example would help make sure I understand the concept correctly.
$guide_action = "moves to"; // NOI18N
if ($region == $section)
{
$guide_action = "stays in"; // NOI18N
}
$msg = clienttranslate('The ${guide_icon} ${guide_action} region ${region_icon}');
self::notifyAllPlayers( "placeGuide", $msg , array(
'i18n' => array ( 'guide_action' ),
'guide_action' => $guide_action,
'region' => $section,
'region_icon' => $section,
'guide_icon' => 'guide'
) );