Languages overview page

This module provides a GUI to change the language fallback system. This will allow you to setup language hierarchies where translations of a site's content, settings and interface can fall back to parent language translations, without ever falling back to English.
It implements hook_language_fallback_candidates_alter(), without which translations from any available language are used as fallbacks, which is usually unexpected.

An Example

In this example, we assume Drupal's default language is English and that you're using Entity Translation module to handle content translation.

  1. Enable language detection based on URL at /admin/config/regional/language/configure.
  2. Goto /admin/config/regional/language and:
    Create Spanish language, with code 'es'.
    Create Spanish (Mexico) language, with code 'es-MX'.
    Create Spanish (Spain) language, with code 'es-ES'.
  3. Order the languages to:
    -- Spanish (Mexico)
    -- Spanish (Spain)
  4. If you have a default Drupal install, go to /admin/structure/types/manage/page and in the
    Publishing options tab select 'Enabled, with field translation' under 'Multilingual support'.
  5. Go to the body field edit page at /admin/structure/types/manage/page/fields/body and
    select 'Enable translations'.
  6. Add some page content in English, then click the translate tab and add in a Spanish translation.
  7. If the node created was node 10, then you should see the following;

    /node/10 - English content
    /es/node/10 - Spanish content
    /es-ES/node/10 - There is no Spain-specific content, so it will display the Spanish content.
    /es-MX/node/10 - There is no Mexico-specific content, so it will display the Spanish content.

Systems covered by this project:

  • Core's content/node translation system as well as field/entity translations (with submodules that add extra functionality, e.g. to translation overview pages)
  • Interface & any i18n string translations (e.g. views, fields, field groups, taxonomies, panels, etc)
  • Listings in views
  • System settings (variables/configuration)
  • URL aliases
  • Menus
  • XML sitemap links
  • Hreflang annotations
  • And more!

Sometimes it's appropriate to apply the language hierarchy to content, but nothing else. Other times everything on a site should go through the same fallbacks. So this module puts the site builder in control by providing a number of submodules within Language Hierarchy that can be optionally enabled to apply fallbacks to each system that is required to have them (see the above list for what's supported). On Drupal's Modules page, they are all grouped under the 'Language Hierarchy' section.

Drupal 8 version

#2825186: Drupal 8 version (D8) of Language Hierarchy

Similar modules

  • Language fallback:
    Another approach to providing language fallback functionality, with different features such as country-specific fallback chains and user geolocation integration, though that is incompatible with page caching. Does not cover menus, site maps, variables, and lacks some other features of Language Hierarchy. See this issue for full comparison & discussion.
  • Sublanguage for Drupal 8 (sandbox):
    A start on fallback functionality for D8
  • Translation Clone:
    Sometimes it's appropriate to duplicate a language from an original language, including all its translations (i.e. for content, interface & configuration), rather than just using the 'fallback' approach.
  • Translation fallback:
    Rather than providing fallback from one language to another, instead provides fallbacks for i18n string translations to the general interface translation rather than being specific to each textgroup/context. This functionality can be used with Language Hierarchy via the patch in this issue.
Supporting organizations: 
Further development, testing & support
Further development, testing & support.
Initial development and support.

Project Information