Client side integration

This section shows how to integrate Weglot to your website. It's quick and easy.

Setup and initialization

Copy paste the following javascript code in your HTML page, just before your < / body> tag.

<script type="text/javascript" src="https://cdn.weglot.com/weglot.min.js"></script>
<script>
	Weglot.setup({
	  api_key: 'API_KEY',
	  originalLanguage: 'en',
	  destinationLanguages : 'fr,es',
	 });
</script>

Replace API_KEY by your own API key. You can get an API key simply by signing up.

Put your original language in originalLanguage and the languages you want to be available in destinationLanguages.

For instance, if your website is in English, and you want it to be available in French and Spanish, you will enter 'originalLanguage' : 'en' and 'destinationLanguages' : 'fr,es'

Then, simply reload your webpage and it is done!
You will see at the bottom right of your website a button to switch language. You can stop reading here or you can continue further to customize the button.

Playing with parameters

You can check the full parameters description of Weglot in our developer space