JavaScript - Integration / Setup

In this article, you'll learn to translate all your content and make your website multilingual within minutes.


1) Create an account on Weglot

You can manage and view all your translations through this account. Create your Weglot account here

2) Select "Other" as your "Website Technology"

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

After validating your email, you will be redirected to the Weglot project page.

If you are integrating Weglot with JavaScript, and your website technology is not listed, choose "Other" as your "Website Technology."


3) Add your new languages


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

After selecting your languages, click on "Next".


4) Choose the "JavaScript Integration" option

To choose to use the JavaScript integration, you need to click on "connect Weglot to your website without it".

Click "Next".

5) Copy and paste the code shown on your screen

The following screen will be displayed:

Copy the code that will appear on your screen below (do not forget to replace "YOUR_API_KEY" with the one found in your dashboard > Settings> Setup.


<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 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 titled "Custom Code" or something similar).

If you're building your site from scratch, paste the JavaScript snippet on all your website HTML pages just before the end of 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 may take a few minutes to appear). You can also change its position - check out our guide to find out how. 

Weglot provides you with the first round of automatic translation. To view them, log in to your Weglot account and go to your dashboard > Translations > Languages. Here, you can review and manually edit all your translations.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us