I have set up Drupal 6.1 (English installation) and enabled the Locale and Content Translation Modules from Core. I want to run a multi-lingual website (English, Spanish, Dutch) using three different domains (mysite.org, mysite.bo and mysite.nl). I've set Admin > Settings > Languages to "domain name only", and created some content for testing purposes. I am currently testing using only English and Dutch.
After doing this I already ran in some trouble, because when adding the language Dutch (and binding this to the domain mysite.nl), I can no longer get into the English interface at mysite.org. mysite.nl is the principle domain name, bundled with my hosting plan, but mysite.org is set up as a server alias, so it should be working fine.
One possible cause for trouble could be that I have installed drupal in a folder at mysite.nl/drupal, and set up myste.nl/drupal and mysite.org/drupal as the selection criteria for Language for Dutch and English respectively. (Reason for the subfolder is that the current site is set up in the root folder).
- Question 1: should Drupal be able to do it's thing with a multi-lingual setup when installed not in the root but in a subfolder?

Problems:
- Can't login to mysite.org as administrator: automatically redirects to mysite.nl
- "RewriteBase /drupal" in drupal's .htaccess file seems not to be working, which is why I specified the subfolder in the Languages tab (which seems to be working more or less).

The goal is of course to have Dutch content displayed only on mysite.nl and English content at mysite.org, so I installed the i18n Module, and have turned on all its functions (except Polls, so far). I've set Admin > Settings > Multi-Lingual System: Content Selection Mode to "Only current language".

Now, I have created both Dutch and English content, but English content won't appear on mysite.org. When I'm not logged in, visiting mysite.org/drupal redirects me to mysite.nl/drupal. Strangely mysite.org/drupal/ (note trailing slash) remains on the .org domain, but still shows Dutch content!

Also, when manually typing a URL for an English node I know to be there, mysite.org/drupal/node/5 results in the correct page, in English. However, typing the URL-alias I have defined, mysite.org/drupal/welcome results in a 404 error (displayed in Dutch, nog English). The URL-aliases on the Dutch .nl pages are working properly.

I guess I misconfigured something, but what? Or could it be that Locale and i18n Modules aren't working 100% yet? This is my first Drupal site, and although setting up most things is running smoothly, this is a big issue for me. I hope I provided the necessary details to respond. Thanks!

Comments

giorgosk’s picture

From you description it seems that you are trying to do complicated stuff
all at the same time

try to setup the site and see that everything is working on ONE domain

Only then try to change ONE thing at a time in order to see what you are doing wrong

otherwise you description is very complicated to get a definite answer on how to solve this problem
(or at least it was not clear to me)

------
GiorgosK
Geoland Web development / web marketing

------
GiorgosK
Web Development

ar-jan’s picture

Will try and report back later. Thanks.

ar-jan’s picture

I've finally come to test and describe the problem again (properly).

I've created my drupal website at mysite.nl/drupal. Enabled i18n module (6.x-1.0-beta1). Added 3 languages: Dutch, English and Spanish. Set language negotiation to "path prefix only" (nl, en and es respectively). Show language switcher in the header. Now everything is working as expected: on www.mysite.nl/drupal/nl/ Dutch content is shown, on www.mysite.nl/drupal/en/ English content and Spanish on www.mysite.nl/drupal/es/.

Now I change the language negotiation to "domain name only" in order to use one top-level domain for each language, and change the language prefixes to the proper domainnames in the language settings (including /drupal in the path, otherwise it doesn't work). The urls in the language switcher block are correct, pointing to www.mysite.nl/drupal, www.mysite.org/drupal and www.mysite.es/drupal. However, only Dutch content is shown! Dutch is set as the default language. E.g. www.mysite.org/drupal shows Dutch content instead of English. Logging out makes no difference. Have I configured something wrong?

The other thing is, when I login at www.mysite.org/drupal the admin navigation menu is shown. Then when I switch to www.mysite.nl/drupal the authenticated user menu disappears and I have to login again. Do I need to do some multi-site configuration to resolve this? (I don't know if this is related more to i18n or multi-site setup, since the website at the three TLD's is actually the same, except in another language).

Any help would be much appreciated!

PawelPohl’s picture

Hi Arjan!

I've had a very similar problem, although with Drupal 5.7, so I'm not sure how relevant this will be to your case. I tried to implement the same setup, mysite.com in English, mysite.tw in Traditional Chinese, and a bunch of other domain/language combinations, but kept running into problems with either the interface or content languages switching back and forth, or being unnecessarily remembered in session cookies and forcing Chinese on mysite.com when the user has visited .tw before.

After a lot of frustration I finally decided to hack the i18n.module and hard-codie language selection based on server name into _i18n_get_lang() function like this:


function _i18n_get_lang() {

  switch($_SERVER['SERVER_NAME']) {
  
    case 'www.mysite.com':
      return 'en';

    case 'www.mysite.tw':
      return 'zh';

  }

  (...)

Not a very clean solution, but it works reliably. Otherwise some strange logic was used that never seemed to work right across domains.

To be able to view and edit all the translations, I am now using a separate website, where I don't force the language selection, as an admin interface.

Once again, this is all for 5.x, can be completely different in 6. Good luck!

Pawel

ar-jan’s picture

Thanks for your response Pawel. I would certainly give your hack a try, but I'm hoping that won't be necessary. Using a seperate site to administrate the content would also be a major drawback.

Does anyone have experience using Drupal 6.2 with Internationalization Module, using "domain name only" as language negotiation?
And can someone confirm that what I want to do is desired behaviour for i18n module? (should I file an issue to it?). Thanks!

Anonymous’s picture

I had a bit of different situation, but also running a multilingual site with unique content in multiple languages.

The temporary solution I came up with is running two installations of 6.2. This because I could not get the search to work with the language paths (See thread: http://drupal.org/node/254536) . Everything else worked like a dream. Just used the core modules for this and set the language path to "Path prefix only", and set the language in the nodes (page/ story).

So your problem might not be with i18n module, but it could be that we are either configuring something wrong or something needs to be patched/fixed to make it work.

As is the site runs like a charm in multiple languages, and I use a two links to switch between the two languages. It is not the optimal solution though. (The theme is being loaded twice for example)

---
Edit: I edited the post and added setting the language part to a node.

giorgosk’s picture

I think you will have a better chance
finding someone having done this already
or you can open up a support ticket there
http://drupal.org/project/issues/i18n

or see if there is any discussion in here
http://groups.drupal.org/i18n
but don't use this for support

------
GiorgosK
Geoland Web development / web marketing

------
GiorgosK
Web Development

ar-jan’s picture

I gave your code a try, but so far I didn't get it to work for me. But maybe I'm not implementing it the right way, I have very little php knowledge.

The code in i18n.module reads (lines 648-651):

function i18n_get_lang() {
  global $language;
  return $language->language;
}

Which I changed into this:

function i18n_get_lang() {
  global $language;
  switch ($_SERVER['SERVER_NAME']) {
     case 'www.mysite.nl':
      return $language->nl;
	  break;
     case 'www.mysite.org':
      return $language->en;
	  break;
     case 'www.mysite.es':
      return $language->es;
      }
}

This leads to the frontpage showing no posts, but the message you get after first installing Drupal (create content, etc.).
I also tried putting return 'nl'; etcetera, like your example, but that didn work either, but led to the website showing only Dutch content, as it was before changing any line.

Hacking i18n isn't really the way I want to go anyway, but I'm waiting for some more feedback (anybody?).

ar-jan’s picture

OK, I have created a support ticket here http://drupal.org/node/255865

PawelPohl’s picture

Hi

Yeah, the hack is dirty and the language variables are probably different in D6. The only experience I have with D6 is a very small bilingual site which seemed to have worked fine "off the bat"... but I don't have access to that anymore and I can't really remember the settings :/

Pawel

careyhung’s picture

all you have to do is to set your language domain as:
"http://www.mysite.nl" for Dutch
"http://www.mysite.org" for English
and
"http://www.mysite.es" for Spanish

don't forget the "http://". If you don't put this, i18n module will not work for "domain name only".