How Weglot 
technically works

A developer’s look at Weglot’s reverse proxy solution and JavaScript integration.
G2 Badges Implementation Spring 2022
language switcher to switch between different languages

1. JavaScript integration

The Weglot JavaScript integration is the fastest and simplest way to set up translations for your website. By just copy-pasting a few lines of JavaScript, you can translate any website in seconds. It’s best used for testing, when you don’t need to be visible on global search engines or when you want to translate private content. The translations are fetched and then inserted into the page by the browser after it has downloaded the page source. This means the translations are not stored in any source code and therefore not detected by search engines.

How does the JavaScript integration work?

  1. Website visitor asks for a page on your website.
  2. Your server sends the page back to the website visitor’s browser in the original language, with a <script> tag calling the Weglot JS library.
  3. The library detects the user language, based on his choice or his locale, gathers all the content, and sends it to the Weglot Translation API.
  4. The Weglot Translation API sends the translations back, and the Weglot JS library swaps the original content for the translations.
javascript integration

2. Reverse proxy solution

Configure Weglot’s Content Delivery Network for a fully translated website in minutes. Edit your DNS settings to create specific subdomains for each new language and point them to the Weglot servers – our reverse proxy servers will automatically retrieve your website pages, detect the original content and swap it for the translations.

Any request for a translated version of your website will deliver blazing fast results to your customer in their native language. Weglot’s reverse proxy solution provides you with a fully SEO-friendly version of your website that’s easily indexed by global search engines.

How does the reverse proxy solution work?

  1. Website visitor asks for a page of your website in French. The subdomain fr. points to the Weglot reverse proxy server.
  2. The Weglot proxy server asks your website server for the original page.
  3. Your server sends the page back to Weglot in the original language.
  4. Weglot detects all the content and sends it to the Weglot Translation API.
  5. The Weglot Translation API sends the translations back and the Weglot proxy server replaces the original content for the translations in the source code of the page.
  6. The French page is delivered to your website visitor.

Automated features

A website translation solution with zero developer effort

No ongoing maintenance costs
computer colourful
Hreflang tag implementation
Syncs with new content updates
Read more on our dedicated developer documentation

Technical FAQ

Your translations are stored on the Weglot database. The Weglot database is fully backed up daily.

Weglot stores all the HTML fragments it translates as well as their translations. It also stores data associated with your project settings, such as glossary rules. You can exclude translations by URL or more finely by CSS selector in order to avoid sending confidential data, such as personally identifiable information (PII), to Weglot.

By default after a project is removed at the termination of the contract, any stored data is removed after 180 days of inactivity – this can be deleted sooner upon request.

Yes, no user data is stored by Weglot. Our translation database is located in AWS Frankfurt.

Weglot’s service is 24/7 with a 99% service level guarantee.

Yes. Weglot reverse proxy servers will automatically retrieve your website pages, detect the original content and swap it for translations.

 

Yes – You can translate any content by directly calling our API. Read our API documentation for more information.

It depends on what you want URLs to look like for your users.

If you want to use subdomains and have your Spanish-translated products page available on es.example.com/product, you’ll need to create 1 CNAME record per translated language and associated subdomain and point them to websites.weglot.com.

If you want to use subdirectories (currently in beta), and have your translated products page available on example.com/es/product, you’ll need to create a single A record for your entire domain pointing to a Weglot IP address you’ll get during onboarding.

Try Weglot on your website
Weglot is trusted by more than 60,000 website owners & developers. Start your Weglot free trial.