Skip to main content
All CollectionsSet up a campaignLanguages
Set up a button to choose a language 🌍
Set up a button to choose a language 🌍

Add a button on your multilingual campaign for the user to choose their language

Updated over 2 months ago

Default language

If your campaign is set up in multiple languages, the user will have the version of the game that corresponds to their default browser language. If the browser is in English and an English version is configured on the campaign, the game will be displayed in English.

Choose your language with a button

1st option:

You can allow the user to choose the language of their game by putting one or more buttons on the homepage. When clicking on this button, the user will be redirected to the language of his choice.

To do this, in the editing part of your campaign:

  • Go to a page and click on the Buttons tab

  • Add a button and click on it

A popup appears at the bottom left of your screen, you can then configure the button in the following way:

  • Actions: Open a new page

  • URL type: External URL

  • Enter your url : it is the url of your game, followed by a parameter allowing you to change the language of the game, for example "?lg=en_en" for the English language.

Example: my game is published on the default url https://adbx.io/démo. This game is configured in all the languages available on the platform. So I will add a button on the home page and for each version, here is the url I will indicate:

If my game is published on a dedicated URL, I have to replace the adbx url with the custom domain name in the urls above. Example: my game is published on https://jeu.adictiz.com/demo so all urls will be: https://jeu.adictiz.com/demo?language=...

2nd option:

Integrate a script into your campaign's Header. This will speed things up and avoid having to modify all the button URLs.

  • Go to the “Settings” tab

  • Header/Footer” section

  • Enter this script:

<script>
window.changeLanguage = function(lang) {
var url = new URL(window.location.href);
var searchParams = new URLSearchParams(url.search);
searchParams.set('language', lang);
url.search = searchParams.toString();
window.location.href = url.toString();
}
</script>

Then :

  • Go to a page and click on the “Buttons” tab

  • Add a button and click on it

A popin appears at the bottom left of your screen, and you can configure the button as follows:

  • Enable JS Call

  • Set content: changeLanguage('en')

✍️ Remember, of course, to change the content ('xx') to the language in question, so if you want to switch to the FR version, for example, you'll need to set changeLanguage('fr').

This configuration will enable participants to switch from one language to another while remaining on the same page, and above all avoid having to modify all your buttons when there's a change of URL, for example.

💡 To learn more about setting up a multilingual campaign, please read this article.


Need help?

Get help from online support by clicking on the bubble 💬

Did this answer your question?