I was recently prompted to test my blog's layout when rendered in right-to-left text. Running a website through an automatic translator into a language like Arabic or Hebrew will show you any weird little layout glitches which might occur.
But mechanical translation is a bit of an unthinking brute. In this example, I had a code snippet which contained the word "link".

Should that word be translated? Obviously not! The code isn't valid unless the element name is in English - and it probably doesn't make sense to reverse the text direction.
Luckily, the HTML specification allows authors to mark specific bits of their page as unsuitable for automatic translations. The translate global attribute can be applied to your markup like this:
HTML
<code translate="no"> <link … > <meta … > <strong>Hello</strong> </code>
Nothing inside that code block will be translated. Hurrah!
But there are some problems with this approach.
Consider this pseudo-code:
// Reverse the polarity of the neutron flow.
$neutron = $atom.flow( direction="backwards" );
Fairly obviously, the code itself shouldn't be translated. It simply won't run unless the syntax is precisely as written. But what about the comment at the top? It would probably be useful to have that translated, right?
It is possible to mark up different parts of a document to be translatable even if their parent isn't:
HTML
<code translate="no"> <span translate="yes">// Reverse the polarity of the neutron flow.</span> $neutron = $atom.flow( direction="backwards" ); </code>
At least, that's my understanding of the specification.
This brings us on to another complex problem. Consider this code block which might be embedded in a page as an example:
JavaScript
// Ensure the age is calculated from the user's birthday var age = today.date - user.birthday;
If translated into Chinese, the comment might say:
JavaScript
// 确保年龄是根据用户的生日计算的 var age = today.date - user.birthday;
But is it useful to have variable names be different between comments and the code?
In some contexts yes, in others no!
And that's where we hit the limits of the current crop of machine-translation algorithms. Without a holistic view of the entire page, and a semantic understanding of how previous words relate to subsequent words, there will always be glitches and gotchas like this.
For now, I'm marking my code blocks as non-translatable but letting comments be fully translated. If you have strong opinions about this - please leave a comment!