Hello,

I would like to set different default languages per subdomain but I don't really exactly how to do this.

http://drupal.org/node/339381 took me in the right path but I have some questions:

1. Different settings.php files, one for each domain. OK so if I have 10 subdomains, I must have 10 settings.php files.

I duplicate my settings.php file to us.settings.php and add the code below:

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

I'm using french language by defaut in my website.

So when I go to us.mywebsite.com, I should have the english defaut language but I don"t.

Do I miss something?
Should I have to change something else into my settings.php?

I will really apreciate some help^^

Thanks :)

Comments

jose reyero’s picture

Status: Active » Fixed

Make sure the settings files are in the right place and are being used, i.e. comment out the database settings for one of them and see whether it breaks (it should).

junro’s picture

My settings files are all in my /www/sites/default folder.

How can I do to see if a settings file like us.settings.php is being used?

junro’s picture

Status: Fixed » Active

I put status on "active" because it doesn't work for me yet, I will need a little help please ^^.

Same problem with same language for differents sub-domains here:
http://drupal.org/node/350848

Thanks

jose reyero’s picture

Status: Active » Closed (fixed)

@Junro,

You need to learn how to set up multisites, which has nothing to do with this module. Read: http://drupal.org/node/346385

Open a support request for Drupal if you need more.

junro’s picture

Title: Different default languages per domain/subdomain » Different default languages per subdomain (not with multisites installation)
Status: Closed (fixed) » Active

Thanks Jose, but I don't want to set up multisites.

I've got only one website with one subdomain per country. All my subdomains share the same drupal installation and the same database.

So, I just need to set a different default languages per sub-domains.

ex:

Sub-domains France ----> French defaut language
USA -----> English default language
UK ------> English defaut language
Spain -----> Spanish defaut language.
Argentina ----> Spanish defaut language.

You could take a look at:

Non-English default language causes translation issues
http://drupal.org/node/340345

&

Add English as string translation when defaut language is not english
http://drupal.org/node/364379

I'm not the only one to have these problems.
Lot of non-us guys try to this system with multiple sub-domains, multiple defaut languages other than English.

mmpro’s picture

Yes, I have the same problem/issue:

I want one installation/database and use the built-in translation tools and then direct users to de.domain.com for german translation and to en.domain.com for english (which is default). Do I really have to set up 2 sites with 2 databases just because I want to use subdomains??

Any help is very much appreciated!

jose reyero’s picture

Status: Active » Closed (fixed)

Please,
do read what multisites are and how to set them up and come back here if any (i18n) question left.

http://drupal.org/node/346385

junro’s picture

Title: Different default languages per subdomain (not with multisites installation) » Different default languages per subdomain

Thanks José, it was so easy...

Just add Different settings.php files, one for each domain and put them in the domains/sub-domain folder in /sites.

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

sites/default/settings.php
sites/example.com/settings.php
sites/example.com.site3/settings.php
sites/sub.example.com/settings.php
sites/sub.example.com.site3/settings.php

If you could take a look here:
http://drupal.org/node/364379
After that, I will have no problems with i18n ^^

Thanks :)

mr.j’s picture

Can this be done with Drupal 5?
There is no language_default in the variables table.