In Drupal 6 the default language is an object stored in a variable. So if you want to have different default languages for each domain/subdomain, you need:

1. Different settings.php files, one for each domain, see the handbook about multisite set ups, http://drupal.org/getting-started/6/install/multi-site

2. To properly set up the language default variable in settings.php. For English as the default language it would be:

$conf['language_default'] = (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => '');

English is the default language if no other is specified. For the subsite using the actual site's default language you can skip this configuration.

Comments

nonsie’s picture

If you are using Domain Access for multisite solution, Domain Locale will allow to define default language and enabled languages per domain.

j-ford’s picture

I have created a multisite multilingual drupal install, and have been strugling for ages with the translation lookup features.

I have got the main site in English, with all of the possible languages associated with it (and content to match).

I have created site two which is in English and uses some content from the main site and has blocks that are specific to this theme.

I then created site three which is in French and uses different content from the main site, but has the same blocks and same theme as site two.

This is all very easy to setup and select the appropriate settings (like you say you can choose the language on a per site basis using Domain Locale) however, this does not seem to all for the translated blocks to appear in the required language.

I know they work, because if I allow French in my site two, and go to sitetwo.com/fr the blocks appear in French. Similarly if I make the default language of site three English, then I can few the site in English and when I select sitethree.com/fr the blocks change to French.

This leads me to the conclusion that the blocks are not truly recognizing what language they are supposed to be in, if the sub-domain default language is different to English. Is this the case? Would the above article actually correct this bug?

I can provide more of a description if this is not accurate enough, or explained well enough.

Cheers,

J

manoloka’s picture

What if English is not the default language?

What do I do with this?

<?php
$conf['language_default'] = (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => '');
?>
nonsie’s picture

Replace it with your default language object - the values for at minimum for language, name, native will be different. The easiest way to look up these values is to look in languages table after you have enabled the language. For example for Hebrew it would be language=he, name = Hebrew, native=עברית, direction = 1, plurals = 2, formula = ($n!=1)

alienzed’s picture

The only issue I can see is that this seems to do more than just set the default language, it also apparently prevents you from switching out of that language while one is at the same 'site'. Am I doing something wrong?

matthewv789’s picture

You can add something like this to your settings.php or settings.local.php to override what's set in the database:

$config['language.negotiation']['url']['domains']['en'] = 'my-en-url.localhost';
$config['language.negotiation']['url']['domains']['de'] = 'my-de-url.localhost';
$config['language.negotiation']['url']['domains']['es'] = 'my-es-url.localhost';
$config['language.negotiation']['url']['domains']['fr'] = 'my-fr-url.localhost';