Throughout my plugin I'm constructing sentences like this:<br><br><span style="font-family: courier new,monospace;"> if ($user_id == $author_id)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $author = 'their own';</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> elseif ($user_id == 0)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $author = 'an';</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> else</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $author = bp_core_get_userlink( $author_id ) . "'s";</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $action = bp_core_get_userlink( $user_id ) . ' likes ' . $author . ' <a href="' . bp_activity_get_permalink($activity_id) . '">activity</a>';</span><br>
<br>What would be the best way of making this translatable? Something like this perhaps:<br><br><span style="font-family: courier new,monospace;"> if ($user_id == $author_id) :</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $liker = bp_core_get_userlink( $user_id );</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $activity_url = bp_activity_get_permalink($activity_id);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $action = sprintf(__('%s likes their own <a href="%s">activity</a>'), $liker, $activity_url);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> elseif ($user_id == 0) :</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $liker = bp_core_get_userlink( $user_id );</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $activity_url = bp_activity_get_permalink($activity_id);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $action = sprintf(__('%s likes an <a href="%s">activity</a>'), $liker, $activity_url);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> else :</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $liker = bp_core_get_userlink( $user_id );</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $author = bp_core_get_userlink( $author_id );</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $activity_url = bp_activity_get_permalink($activity_id);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $action = sprintf(__('%s likes %s\'s <a href="%s">activity</a>'), $liker, $author, $activity_url);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> endif;</span><br><br>My only worry is that the sentences are almost identical, I don't want translators having to do too much repetition.<br><br clear="all">-- Alex (Hempsworth)<br>