Could you try writing something like this at the top:
$template = '<span lang="en" class="multilang">Test English</span><span lang="ru" class="multilang">Russian test</span>';
Then see if that works when you switch between English and Russian (I'm guessing you are working with Russian, based on your profile, but substitute a different language if that is more relevant).
If that works, then something is wrong with the data in the $template variable, if it doesn't work, then you'll need to try and debug it to find out where it is going wrong (Xdebug + a suitable IDE will make this a lot easier).