Last updated July 20, 2012. Created by Jose Reyero on April 5, 2007.
Edited by Ayesh, add1sun, Ian Ward. Log in to edit this page.

Some text and settings are stored in Drupal as variables, and some site wide ones like 'site name' and 'site slogan,' along with module specific ones, can be edited through the administration pages. The Internationalization module makes it so these variables can be translatable.

To enable these variables to be translatable we need to identify the low level names Drupal uses for them. This can be done looking at the 'variable' table in the database or searching through the code. However, we'll show you how to translate the more common setting below.

Once you have identified the variables you want to be translated, they need to be added in the settings file as follows:

/**
* Multilingual settings
*
* This is a collection of variables that can be set up for each language when i18n enabled.
* These are the basic ones for Drupal core, but you can add your own here.
*/
$conf['i18n_variables'] = array(
  'site_name',
  'site_slogan',
  'site_mission',
  'site_footer',
  'anonymous',
  'menu_primary_menu',
  'menu_secondary_menu',
);

The configuration file is usually under /sites/default/settings.php or another subfolder depending on the settings of your site. Also there may be more than one if you are using a multi-site set up.

Once you have the correct settings added to your configuration file, they'll be marked as 'multilingual variable' when you go to the corresponding administration pages. You must switch the site language while in the administration pages to set the value for each language

Multilingual variables
Figure 1 - Multilingual settings

AttachmentSize
446371032_5066593810.jpg23.19 KB

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

If you are using the contact form, add this variable to settings.php as well:

'contact_form_information',

This will enable you to change the "You can leave a message…" line on the contact form into other languages.

As mentioned above, you must switch the site language while in the administration pages to set the value for each language. In other words, you must switch site language while you are on admin->site building->contact form under the settings tab before saving the sentence in each language.

If you are using different nodes/paths for different languages and you want to use these as your frontpages, you need to make

'site_frontpage'

a multilingual variable so that you can specify different frontpages per language in /admin/settings/site-information (by switching language once in that page, as usual).

Did you really get this to work? See this thread where we're all finding that i18n doesn't seem to support site_frontpage properly.

http://drupal.org/node/249694

-comment added in wrong spot. Please delete.

Hi,

I can't seem to properly translate the Contact Form page title "Contact Us", which doesn't appear to be in the variables table.

I have links to the contact form for each language's secondary links menu but for some reason, when I'm in English mode, the contact page title is in the other language. The page title is always in the other language despite the language mode. Has anybody encountered this issue and have any suggestions for solving it? Thanks.

First things first, I'm using:

- Drupal: 5.7
- MySQL database: 5.0.67
- PHP: 5.2.6-0.dotdeb.1
- Mysite module: 5.x-3.3

I would like to create multilingual variables for mysite page information like:
- MySite Sitename
- Personal Page Title
- Et cetera

Does anyone know how to create these?

Or, more in general:
how to find out the names of variables that can be used as multilingual variables?

Thnx,
Marc

___________________
discover new oceans
lose sight of the shore

___________________
discover new oceans
lose sight of the shore

Hmm, this seems to be easier than I thought it would be...
Just a matter of checking the variable table ;)

So forget my question above...

___________________
discover new oceans
lose sight of the shore

___________________
discover new oceans
lose sight of the shore

Where is the complete variable table? Been looking in all the readme.txt files without success, can't find it with google either... thanks

To find the variable table, you need access to the Drupal database.

To access you need user/password (from your provider)
and you can use tools like:

- phpmyadmin
- sqlyog
- sql buddy

Once in the database, there's a table "variable".

___________________
discover new oceans
lose sight of the shore

OK thanks, got there with phpmyadmin, very interesting

If you have devel module installed [http://drupal.org/project/devel] , go to "/devel/variable"

I got it working too! Thanx people for sharing the info.

Is there any module that does this without users having to fiddle with their settings.php files? Is there at least any issue in the i18n module for this?

Clear drupal *and* browser caches for this to work.

I can't get it work on D7 for Submitted By, i added to my settings.php at the end of the file:

$conf['i18n_variables'] = array(
  'submitted_by_article',
  'submitted_by_comment_article',
);

And switched the admin site language in the content type edit page after to set the desired text for spanish directly but it just shows me up the text in one language. In this case the last language text i saved under the content type submitted by options.

@ckng could you explain more the workflow to get this work?

Thanks in advance.

Yo love Drupal

@elvismdev

I just get nothing by doing what you did...
However, and since I don't need to use other tokens than the original ones, but just to get rid of the text, I managed to make it this way - without using the "Submitted by" module :

First, override the value of 'Submitted by !username on !datetime' for the default language directly in the settings.php file, by searching for "String overrides:" in the file, and following the basic explanation. With english as default language, for instance:

$conf['locale_custom_strings_en'][''] = array(
  'Submitted by !username on !datetime' => '!username, !datetime'
);

Then,

  1. go to /admin/config/regional/translate/translate
  2. search for the original string: 'Submitted by !username on !datetime'
  3. translate accordingly to the overriding in settings.php (just exactly the same in my case)

voilà