JavaScript Translation Snippet

Make your website multilingual with Weglot

JavaScript logo

Developers, designers, and site-owners, this one’s for you: a simple, copy-paste JavaScript snippet that will transform your monolingual site into a multilingual one in less than 5 minutes.

Weglot is compatible with whatever web technology you’re using to develop your site. Connect Weglot to your website and we’ll do all the heavy lifting for you. Our Translation API will detect all your website content and deliver it back to you in any language. No maintenance, no pain. Plus, we’re trusted by more than 50,000 website owners.

Key Benefits

Quick install: Ready in less than 5 minutes.


All content detected & translatable: text, images, even metadata.


Easily manage all your translations from a single interface.


No need to start from scratch: get a first round of automatic translations.


Invite team members or work with professional translators.


Weglot dancing character

Let’s start translating your website.

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.

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

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”.

weglot setupguide js inte

4) Choose your original & destination languages.

Specify the original language of your website (the language you created it in), as well as the language(s) you want to translate it into.

In the example below, the website was originally in English, and is set to be translated into French.

Click “Next”.

5) Copy the code shown on your screen.

This part is pretty easy.

HTML

6) Paste the code.

If you’re using a CMS to build and manage your website, find the place on your dashboard where you’re able to add code into the <head> section of your HTML pages. 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.

7) You’re done! Head into your dashboard and start editing.

Go to your website, and you should see the language button at the bottom right of the page (it might take a few minutes to appear).

Try changing the language, you should see your website translated into the desired language instantaneously!

Weglot provides you with a first round of automatic translations, which you can then review and manually edit within your Weglot account dashboard.

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

If you decide to install Weglot with this JavaScript integration, you’re all set for translating your site content, no matter what development stage you’re at. 

Once you’ve got your site live and are starting to think about SEO, you might want to have a look at our General Integration page—this is where you can learn how to make your website SEO-compatible and well-indexed on search engines in all your final languages.

READY TO GET STARTED?
Make your website multilingual within minutes