Google Translate Macro
Last modified by Thomas Mortagne on 2026/02/26 15:38
| Translates the full wiki page into a language using Google Translation |
| Type | XAR |
| Category | |
| Developed by | |
| Rating | |
| License | GNU Lesser General Public License 2.1 |
Table of contents
Description
Place the following macro in your page and it'll offer a select box to choose a language. When the language is selected the full page is then translated in the selected language.
{{translation/}}For example selecting "Yiddish" will give:

Source
For reference, the Macro contains the following source code:
{{velocity}}
{{html}}
<div class="noPrint" style="float: right;" id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: '$doc.defaultLanguage', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
{{/html}}
{{/velocity}}To use the noPrint class you need the css-extension:
@media print
{
.noPrint
{
display:none;
}
}