beelate

SEO techniqueOctober 20264 min readUpdated October 30

Translating in JavaScript: why Google may never see your translated pages

A widget that translates the page in the browser gives the impression of a multilingual site. Your visitors do see the translations. Google, however, may never see them.

On the left, a visitor sees a store translated thanks to a language selector: "Your visitors see a translated site." On the right, Google's bot only sees a grayed-out page: "Google often only sees the original version."

Two ways to translate a page

Website translation tools fall into two families. The first work in the browser: the page arrives in French, then a script replaces the texts once loading is complete. The second work on the server: the page leaves already translated, as if it had been written in that language.

For a visitor, the difference is often limited to a brief flicker of the original text. For a search engine, it decides whether the translation exists or not.

What Googlebot does with a translation script

Googlebot executes JavaScript, but in two stages. Google describes this in its documentation on JavaScript SEO fundamentals: the page is first crawled, then placed in a rendering queue, which may occur later. If the translation script fails, takes too long, or waits for a user action, such as a click on the language selector, the translated version is never produced on Google's side.

Other bots are less patient. Social network link previews and many AI tool bots only read the received HTML, without executing scripts. For them, the page only exists in French.

A single URL for all languages

The most common problem is not rendering, it's the address. Most widgets keep the same URL regardless of language and store the visitor's choice in a cookie. However, Google recommends a distinct URL for each language version and advises against changing a page's language based on a cookie or browser settings.

The reason is simple: according to Google's documentation, Googlebot most often crawls from the United States and without a language preference. A page that adapts its language to the visitor therefore risks being indexed in only one version. Your German translation may be impeccable: without an address of its own, it can neither appear in German results, nor receive links, nor be shared.

Without a dedicated URL, a translation cannot be indexed.

Read alsoHreflang, subdirectories or subdomains →Organizing URLs and announcing each language to Google.

What server-side rendering changes

With server-side translated content, each language has its own address, such as /en/ or /de/, and the delivered HTML already contains the translated text: titles, paragraphs, title tag, meta description, image alt texts. The crawler receives what the visitor sees, without any script to execute.

This can be achieved in several ways: managing languages in the CMS, generating static pages per language, or using a translation proxy that translates pages on the fly. Tinidy, which publishes this site, uses this third approach: the proxy receives the request, serves the page in the correct language, and adds the hreflang tags.

Check your site with four tests

  1. Open a translated page and view its source code (Ctrl+U), not the inspector. The inspector shows the page after scripts have run; the source code shows what a bot that runs nothing receives. Is the text in the correct language?
  2. Switch languages with the selector: does the address in the browser bar change?
  3. In Search Console, run the translated URL through the URL Inspection tool and look at the HTML rendered by Google.
  4. A few weeks after going live, search Google for an exact phrase from the translated version, in quotation marks. If nothing comes up, that version is not indexed.

Just one negative answer is enough: your translations serve your visitors, but not your SEO. Once each language is served on its own URL, you still need to announce it properly to Google; that is the subject of our article on hreflang and multilingual architecture.

International SEO

Hreflang, subdirectories, subdomains: the architecture that makes a translated site exist

Strategy

Single-language website: the invisible cost of each month of delay