GTranslate integration

3 min read

GTranslate translates your pages in the visitor's browser, on the fly. TTSWP works alongside it: you generate audio for each GTranslate language, and when a visitor switches language the player automatically loads the matching audio. If a language doesn't have audio yet, the player simply stays hidden for that language.

Requirements

  • The GTranslate plugin active, with at least one destination language enabled
  • A TTSWP paid plan (the GTranslate integration toggle is locked on the free plan)
  • TTSWP connected to your site

Turn it on

  1. Go to Text to Speech → Settings.
  2. Find GTranslate integration and switch it on.
  3. Save.

If the GTranslate plugin isn't detected, the toggle is locked and shows "GTranslate not detected". On the free plan the toggle is locked as well.

Map voices to languages

With the integration on, open Text to Speech → Language Voice Mapping and assign a voice to each GTranslate language. A language with no specific voice falls back to your default voice. See Language Voice Mapping for details.

Generate per-language audio

GTranslate translates text in the browser, so the server always sees your site's default language. To give each language its own narration, generate audio per language from the post list:

  1. Go to the Posts (or Pages) list.
  2. In the TTS column each GTranslate language has its own row.
  3. Click generate on a row to create audio for that language.

You can also attach your own audio file to a language instead of generating it — see Custom audio files. Custom audio overrides the generated voice for that language.

How it works for visitors

  • The page loads in your default language and TTSWP includes a small map of "language → audio file" for the post.
  • When the visitor picks a language with GTranslate, the player swaps its audio to the matching file — no page reload.
  • For a language that has no audio (generated or custom), the player hides itself, so visitors only ever see a player when there's something to play.

Language code notes

GTranslate uses its own language codes. TTSWP normalizes the ones that differ from the voice provider automatically (for example Norwegian nb/nn map to no, and zh-CN maps to zh), so each language lines up with the right voice and audio file without any manual work.

Known quirks

  • Because GTranslate works in the browser, the server-rendered page is always your default language; the per-language audio is selected client-side. This is expected.
  • A post can have audio in some languages and not others. The player appears only for languages that have audio.
  • If you add audio for one language only (for example a custom file in English on a Norwegian site), the player shows when viewing that language and stays hidden in the others.