Translate Drupal with GTranslate

Integrates Google Translate to provide automatic website translation, supporting 103+ languages with multiple display options.

gtranslate
12,443 sites
32
drupal.org

Install

Drupal 11, 10, 9 v3.0.4
composer require 'drupal/gtranslate:^3.0'
Drupal 8 v8.x-1.15
composer require 'drupal/gtranslate:8.x-1.15'

Overview

GTranslate is a powerful multilingual module that integrates Google Translate to make your Drupal website accessible to users worldwide. With support for over 103 languages, this module enables automatic translation of your website content, reaching more than 99% of internet users globally.

The module provides a customizable language selector block that can be displayed in various formats including country flags, dropdown menus, or a combination of both. It supports both free on-the-fly translation using Google Translate's widget and premium translation services with SEO-friendly URL structures.

For websites requiring better search engine optimization, GTranslate offers paid plans that support sub-directory URL structures (example.com/es/) and sub-domain URL structures (es.example.com/), making translated content indexable by search engines.

Features

  • Automatic website translation powered by Google Translate with support for 103+ languages
  • Multiple display modes: flags only, dropdown only, flags with dropdown, or elegant dropdown with flags
  • Customizable flag sizes (16px, 24px, or 32px) for optimal visual integration
  • Per-language visibility control allowing you to show/hide specific languages or display them as flags only
  • Support for sub-directory URL structure (/es/, /fr/) with paid GTranslate Pro plan
  • Support for sub-domain URL structure (es.example.com) with paid GTranslate Enterprise plan
  • Option to open translated pages in a new browser window
  • Accessibility-friendly language selector with ARIA labels
  • Automatic detection of current translation language via HTTP headers

Use Cases

Quick Multilingual Support for Small Websites

A small business or personal website can instantly become accessible to international visitors by installing GTranslate and placing the language selector block in the header or sidebar. With minimal configuration, visitors can translate the entire site into their preferred language using Google's translation engine.

E-commerce International Expansion

An online store looking to expand internationally can use GTranslate to provide product descriptions and checkout processes in multiple languages. The 'Nice dropdown with flags' display mode creates a professional appearance, while the ability to selectively enable popular languages helps focus on target markets.

SEO-Optimized Multilingual Content

Websites requiring search engine visibility in multiple languages can upgrade to GTranslate Pro or Enterprise plans. The sub-directory (/es/page) or sub-domain (es.example.com/page) URL structures allow search engines to index translated content separately, improving international SEO rankings.

Government or Educational Accessibility

Public sector websites required to provide multilingual access can use GTranslate to quickly offer content in numerous languages. The accessibility features including ARIA labels ensure the language selector is usable by visitors using screen readers.

Temporary Multilingual Solution

Organizations planning to implement full Drupal multilingual functionality (with Interface Translation and Content Translation) can use GTranslate as an interim solution to provide immediate multilingual access while the comprehensive translation infrastructure is being developed.

Tips

  • Start with the 'Flags and dropdown' display mode for the best balance of visual appeal and usability
  • Set your main language correctly to ensure the translation engine works properly
  • For better performance, only enable languages that are relevant to your target audience rather than all 103+ options
  • Consider placing the GTranslate block in a prominent location like the header or top of the sidebar for maximum visibility
  • Use the 'As a flag' option (value 2) for your most popular target languages to provide quick one-click translation access
  • Test the translation quality for your specific content before relying on it for business-critical information

Technical Details

Admin Pages 1
GTranslate Settings /admin/config/regional/gtranslate

Configure GTranslate module settings including display appearance, main language, and per-language visibility options.

Permissions 1
Configure GTranslate

Allows users to access and modify the GTranslate configuration settings page.

Troubleshooting 5
Translated content reverts to original language on page navigation

This is normal behavior for the free on-the-fly translation mode. Each page load triggers a new translation. For persistent translations, consider upgrading to a paid GTranslate plan with URL-based language switching.

Flags not displaying correctly

Ensure the gtranslate-files directory exists and contains the flag sprite images. Clear your Drupal cache and browser cache. Verify the module path is correctly resolved.

Translation not working for specific languages

Check the Language Configuration settings to ensure the desired language is set to 'Yes' or 'As a flag' rather than 'No'. Some less common languages may have limited translation quality.

Google Translate widget showing on the page

The module includes CSS to hide the default Google Translate widget. If it's still visible, check for CSS conflicts with your theme and ensure the module's styles are loading correctly.

Sub-directory or sub-domain URLs not working

These features require a paid GTranslate Pro or Enterprise subscription. You'll also need to configure your web server and DNS appropriately. Contact GTranslate support for assistance with server configuration.

Security Notes 4
  • The module loads JavaScript from translate.google.com which is Google's official translation service
  • When using paid plans with sub-domain URLs, ensure proper SSL certificate configuration for all language subdomains
  • User-selected language preferences are not stored persistently by the free version, avoiding cookie/privacy concerns
  • The module uses HTTP headers (HTTP_X_GT_LANG) to detect the current language when using paid plans