Explanation on how to set the language of the embed for multi-lingual sites
There are 2 methods to set the language on an embed. The first is to have different versions of the embed and the second is to use JavaScript to change the language. It should be noted that once a client logs in they will be able to set the language in the sidebar.
Please note that the language must be enabled on your portal account in order to be able to display that language. To do this please go to your portal account then go to Settings > General > Languages
1 - Using different versions of the embed
The embed code can be set to display a specific language manually. To do this we need to add the following to the <div> of the embed:
data-initial-language='en'
This would set the initial language to English. An embed code with this set would look like this:
<div data-initial-language='en' id='flipdish-menu' data-restaurant='yourappid'></div><script id='flipdish-script' type='text/javascript' charset='UTF-8' src='https://web-order.flipdish.co/client/productionwlbuild/latest/static/js/main.js'></script>
If you then also wish to have an embed code for French then you change the language code in the language data attribute;
data-initial-language='fr'
These will need to be placed on different pages as only one embed code will work per page
2 - Using JavaScript to change the language
The languages can be changed using a JavaScript function. This is useful as you can have a button on the page that when clicked will change the language of the embed.
The function to change the language is as follows:
_flipdish.setLanguage('en');
This will set the language of the embed on the page to English.
In order to change languages, the language code needs to be changed. So in order to change it to Spanish, the following function needs to be used:
_flipdish.setLanguage('fr');
A basic example of how this can be used can be seen in the code below:
<script> function english(){ _flipdish.setLanguage('en'); } function dutch(){ _flipdish.setLanguage('nl'); } </script> <button onclick='english()'>English</button> <button onclick='dutch()'>Dutch</button>
If the button labeled English is clicked it will change the language of the ordering system on the page to English, and when Dutch is pressed it will change the language to Dutch.
To learn more about Flipdish's products or how to grow your online business enroll for FREE in the Flipdish Academy here: http://academy.flipdish.com/