On Jul 4, 10 04:57, Walter Bright wrote:
Andrei Alexandrescu wrote:
Walter Bright wrote:
Walter Bright wrote:
Michel Fortin wrote:
On a side note, I've noticed on other websites that Google
Translation doesn't attempt to translate code inside a <code>
element. So I would suggest the website uses <pre><code> ...
</code></pre> for its code blocks, and <code>...</code> for
keywords and other code-related terms in the text. That could
actually make the translation useful.

This must be new, it didn't use to do that. I'll take advantage of it!

Sadly, it doesn't work, as it strips all the newlines out, putting
your code all on one line. Bah :-(

How about nesting them the other way around? <code><pre>...</pre></code>?

I tried that, too. It recognizes the newlines, and then translates the
code. Back to square 1.

You could use <pre class="notranslate"> to suppress translation. It's documented in http://translate.google.com/support/.

Reply via email to