
You probably already know this, but while I was looking at Google Analytic stats yesterday I noticed that quite a few was translating the site. And since it’s filled with configuration- and code examples I could see that Google strangely tried to translate the code and confs as well, thus screwing it all up.
I’m a big fan of Google Translate so I did a quick search which revealed that all one had to do was to add the class=notranslate to any HTML element to prevent that element from being translated.
We use the Codecolorer plugin to display code and confs on the site. So I edited the plugin and found where it inserts the div wrapper class and added the notranslate class to it.
And that’s it, now the code and confs doesn’t get translated anymore.
Here is an example:
Hope this was a helpful tip for anybody who publishes anything which shouldn’t get translated.




Posted in
Tags:
«







A wonderful job. Super helpful information.