Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I noticed that a Drupal core function is using the following code:

$categories = db_select('contact', 'c')
  ->fields('c', array('cid', 'category', 'recipients', 'selected'))

When should a module add that tag to the query it is executing?
What is the effect of adding that tag? What is effectively altered, in the query object, or in the result returned by the query?

share|improve this question
up vote 1 down vote accepted

On it's own, that tag doesn't much (yet).

This is the so called "Dynamic data translation" feature, the idea was born on Prepare Drupal core for dynamic data translation.

Basically, you define in your hook_schema() (See contact_schema() for an example) which fields can be translated, and then add the "translatable" tag to all queries which fetch the data. Use 'translated' => TRUE' for all such columns.

Then, what is supposed to happen is that a contributed module can maintain separate tables per language for your translatable columns, automatically join these tables, and replace the selected columns with those from translated table.

However, as far as I know, nobody has yet attempted to write such a module.

share|improve this answer
In that report I read that translatable fields are marked in hook_schema() with 'translatable' => TRUE. Is that correct? – kiamlaluno Mar 23 '11 at 18:05
Exactly, updated the answer and added a link to contact_schema() – Berdir Mar 23 '11 at 18:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.