JavaScript - Integration / Setup

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


Please note that the JavaScript integration is different from the WordPress one, so if you are using WordPress, you should read this article to see how to set Weglot up on your website.


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"

After signing up, you’ll receive a validation email.

Once your email is verified, you’ll be redirected to your Weglot Project page.

If your website technology is not listed, select “Other” as your Website Technology — this option is designed for custom or JavaScript-based websites.


3) Add your new languages

Next, enter:

  • The original language of your website
  • The new language(s) you want to translate your website into

After selecting your languages, click “Next.”

After selecting your languages, click on "Next".


4) Choose the "JavaScript Integration" option

When prompted, select “Connect my live website.”

You’ll then see a blue section titled “Looking for the easiest setup?” — this is the JavaScript integration option.


5) Copy and paste the code shown on your screen


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!

Once the code is installed, your website will automatically be translated.

  • Visit your site and you’ll see the Weglot language switcher (usually at the bottom-right corner).
  • It may take a few minutes to appear the first time.

You can also change its position — check out our guide on customizing the language switcher for more details.

Weglot automatically provides the first round of translations for your website.

To review or edit them:

  1. Log in to your Weglot account
  2. Go to Dashboard > Translations > Languages

Here, you can view, manage, 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