Technical overview

Last modified: September 25, 2008 - 09:48

This is a technical overview of how the i18n module works, how it integrates with Drupal, and some tips to take advantage of the module's API for advanced customizations.

Data Model

This module adds a minimum amount of data to Drupal's database, linked to objects that may be translatable, like nodes and taxonomy terms.
The two pieces of information we need for the system to work are

  • Language property: This is the 'language' text field that keeps language code for some objects, including nodes, taxonomy vocabularies, taxonomy terms, and menu items.
  • Translation ID: This is the 'trid' field that provides the relationship between multiple objects that are translations of each other.

[Table explanation and link to data model picture]

Drupal Integration

As the module has evolved from a set of developer's tools to an end user's pluggable module, it has avoided as much as possible to patch Drupal core, relying instead on several powerful mechanisms built into Drupal.
Path rewriting
...
Query rewriting
...
Node system and taxonomy hooks
....
Forms API
...

i18n API

Some API functions used by the modules internally can also be used to take advantage of some of the features or to build custom pages, blocks, or theme snippets.

 
 

Drupal is a registered trademark of Dries Buytaert.