​PageObject: Google Translator

​This PageObject inserts a Google Translator widget to the content. A Google Maps API Key is not required.

As there are three options for displaying the widget (vertically, horizontally and as single drop down menu), the template should contain layout specifications for each option.

HTML example (system generated)

<div class="fx_po_translator">
    <div id="fx_po_translator_element"></div>
    <script>function googleTranslateElementInit() { … }</script>
    <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</div>

​Demo content

Available parameter:

  • display: [string] Display mode of translator widget. Available options are “vertical”, “horizontal” and “dropdown”. Optional, default is “vertical”.

Configuration example

{{ fx_page.slot("SLOT_NAME", _context, {"content": [
   {"type": "translator"}
] }) }}
​For more details how to implement demo content please refer to the Demo Content Documentation.