Hey everybody,

I'm using i18n on Drupal 6 to achieve full multilanguage abililty, but can somebody please tell me, how to get a multilanguage front-page (default is german, users can switch to english and spanish)?

Using the seach-function and googling didn't help :-(

Many thanks in advance, rubaff!

Comments

quotientix’s picture

Addition:

switching languages changes the path from i.e. ?q=node/3 to ?q=en/node/3, but how do I link the en to the actual english node.
For all other pages, when I click on translate, new nodes are created.

thx :)

fw_crocodile’s picture

Hi, i'm new to drupal so probably there are some better solution, anyway that's how i resolv the problem:

1 - enable clean URL
2 - enable path module in core - optional

2 - Create the three pages you need (German Spanish English) giving to each one the same URL alias (example "primapagina")

if I go in my URL aliases management page (admin/build/path) I see:

primapagina node/1 Italian edit delete
primapagina node/2 French edit delete
primapagina node/3 German edit delete
primapagina node/4 English edit delete

3 - In the site information page admin/settings/site-information
fill the default front page field with the alias you've used. In my case "primapagina"

That's all now changing language using the language switcher block work perfectly for the front page too.

quotientix’s picture

Many thanks for your answer,

works perfectly for me! :)

eliosh’s picture

Perfect solution!

--
Ing. Eligio Colutta
Pulse s.a.s.
http://www.pulsetech.it

--
eLiosh

houen’s picture

+1 on the solution - simple and clean - thx

astra’s picture

Really perfect! Simple and logical.

sobi3ch’s picture

+1 for rubaff

narendrak’s picture

It works for me. Thanks a lot fw_crocodile ..

onelittleant’s picture

Great solution. I've had problems with this issue in all versions of Drupal... this is a nice way to solve it, not only for the homepage but for other important pages as well.

sean_e_dietrich’s picture

Works wonderfully!!!

coreykck’s picture

Enable PHP input format;
Create page node with this php code

global $language;
switch($language->language){
case 'it': $path='node/1'; break;
case 'es': $path='node/10'; break;
case 'de': $path='node/11'; break;
default: $path='node/17';
}
drupal_goto($path )

change node numbers as your wish
Use this node as first page
Well done themes, like garland, url to first page was inserted with this code: check_url($front_page) so, if your theme calls first page using base_path() change it to $front_page.
Bye
Corrado

kepesv’s picture

1., Insert these lines to the end of settings.php file.

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

2., Visit "admin/settings/site-information" for all language and set the independent front pages.

adraskoy’s picture

The settings.php variable as mentioned in the previous comment works best for me.

kingduct’s picture

Thanks!

krembo’s picture

This doesn't work... maybe because it still not stable version of i18n. But I have set three different pages for three languages. Checked twice. When on home page changing the language, the page is still the same...

-----
Ok. This was because I didn't check the front page variable in i18n configuration. Sorry guys.

silviucostiniuc’s picture

Yep. I confirm it ..... it's not working in Drupal 7 ....

silviucostiniuc’s picture

In the meanwhile for Drupal 7 - if you're dealing with nodes:

ex:
node/1 = First page English
node/2 = Premiere page Français

you cand let the site's default page as /node and you set both nodes as Promoted to front page at Publishing options.

criscom’s picture

For me everything works fine with the normal settings. On the frontapge, when I click on the Language Switcher to change from German (standard language) to English, the whole node changes to the English translation (as it shoudl) except for the Title. The title remains German. So I have a frontpage with a German title and an English body. Strange.
Has anyone got the same problem? And is it related to this issue discussed here?

----------

I could solve this problems giving the german and english nodes a path called "vision" and set the frontpage paths in the variables settings at website information > standard frontpage as described in one of the posts above. http://drupal.org/node/250217#comment-818479

deltacentaurus’s picture

Dear,
Do you have found a solution about it with drupal 7 ?
Regards

kmetz’s picture

Say you have enabled English and German, and

node/1 == system path of the German front page
node/2 == system path of the English front page

The trick:
1) Set your "Default front page" (on admin/config/system/site-information) to node/1

2) Manually create another alias (on admin/config/search/path/add):

  • Language: English
  • Existing system path: node/1
  • Path alias: node/2

Magically works. I'm shure aliasing from system paths to system paths is dirty, tough.
Other human-redable aliases to these nodes can co-exist if they have a specific language set.

Substitute German for your primary and English for your other language in the example. Should also work with more than two languages.

And of course you need to have the "Path translation" module, part of the i18n package, enabled. I'm using version 7.x-1.0-beta5.