Skip to main content

Ticketing widget

Changing the widget language

Adding an existing language

The language of the ticketing widget can be changed through Enviso settings. Use the language variable for this:

<script>
    enviso.settings.language = 'en';
</script>

The translations for English, Dutch, French, German and Spanish are already available. If you wish to add another language you will have to implement it. Refer, Implementing a new language

Customizing an existing language

<script>
    enviso.settings.translations = {
        'nl' : {
                'My Order': 'Winkelmandje',
                'Ticket' : 'Toegangsticket'
            }
    };
</script>

Implementing a new language

For example, you want to implement Italian:

  • Determine the key for the translation you want to customise

  • To implement the language, you will need to provide a translation for every key

    Note

    If you require translations for languages other than the languages available in the Ticketing widget, contact our Support desk.

<script>
    enviso.settings.translations = {
        'it' : {
                'Ticket': 'Biglietto',
                'My Order' : 'Il mio ordine',
                // All other keys
            }
    };
</script>

Once the keys are added,  you just set the language setting of the Ticketing widget to the new language.

<script>
    enviso.settings.language = 'it';
</script>

Example of code for multiple languages

Adding multiple languages can be done via code.

<select id="select-language" onchange="changeLanguage()">
    <option value="nl"> NL (Dutch) </option>
    <option value="fr"> FR (French) </option>
    <option value="en"> EN (English) </option>
    <option value="de"> DE (German) </option>
    <option value="es"> ES (Spanish) </option>
</select>
<hr>
    <enviso-ticket-widget> </enviso-ticket-widget>
    <script>
        enviso.settings.language = 'nl';
        enviso.settings.translations = {'nl': {'My Order': 'Winkelmandje'}};
        function changeLanguage() {
            console.log(arguments);
            enviso.settings.language = document.getElementById("select-language").value;
        }
    </script>

Note

In order to translate offers, go to Enviso Sales > My Offers > Select an offer. For a detailed description on translating offers, refer Add translations for an offer