JavaScript - Integration / Setup

Translate your JavaScript website

Translate all your content and make your website multilingual within minutes.

1) Create an account on Weglot

This account will be the place where you’ll be able to view and manage all your translations. Simply create a Weglot account here.

javascript-translate

2) Select “Other” as your “Website Technology.”

javascript-select

3) Choose the “JavaScript Integration” option.

You should receive a validation email in the account with which you signed up.

After validating your email, you will arrive on the Weglot setup page, as shown below. Scroll down to the box that says “Other possible integrations,” and click on “Use Javascript integration”.

choose-javascript

4) Add your new languages

You’ll then be prompted to enter the original language of your website + the new language(s) you want to translate and display your site into.

add-languages-javascript

Click “Next”.

5) Copy and paste the code shown on your screen

This part is pretty easy. Copy the code that will appear on your screen (replacing “YOUR_API_KEY” with the one found in your Weglot setting).

<script type="text/javascript" src="https://cdn.weglot.com/weglot.min.js"></script>
<script>
    Weglot.initialize({
        api_key: 'YOUR_API_KEY',
    });
</script>
			

Then paste it into the <head> section of your HTML pages (if you’re using a CMS to build your website, this is usually located in the CMS settings, under a tab that will be titled “Custom Code” or something similar).

If you’re building your site from scratch, simply paste the JavaScript snippet on all your website HTML pages just before the </head> tag.

Your website is now translated!

You’ve now successfully translated your website using JavaScript. Go to your website and you’ll see a language switcher at the bottom right of your site (it might take a few minutes to appear). 

Weglot provides you with a first round of automatic translation, which you can then review and manually edit within your Weglot account dashboard under ‘Translations’. 

Log in to your Weglot account and then go to “Translations” to find all your translations and edit them.

Still need help? Contact Us Contact Us