Some localisation tools like Virtaal handles XML (HTML) tags in a way that makes it easy for the translator to work with. The other option is to simplify the string presented to your localisers by replacing the tag with a string formatting variable and making the format string localisable in stead of the result of the formatting. For example (I'm mostly guessing for the sake of the example and don't know PHP very well):
printf(_("Hello, I'm %sa sample%s, greetings to all of you!"), '<a href="test.php" title="Title-Attribute" rel="test">', "</a>");
In the above statement the string that the localiser will see is only the one containing the %s
formatting variables (because it's wrapped in the _()
gettext function). This, of course, has the drawback of being quite confusing to a localiser if (s)he is unaware of what the variables will be replaced with, so do include a proper localisation comment.