I am trying to create a new site using Drupal 4.7 and CVS version of i18n. I discovered a strange behaviour of site frontpage.

1. Clicking on site name always goes to mysite.com, not to mysite.com/{en|cs} (as it was in 4.6). As a result, clicking on site name means it switches do default language every time. I think is would be better to keep selected language - many people use clicking to site name to navigate to frontpage.

2. Site mission is only displayed on mysite.com URL. When I add langcode (mysite.com/en), the page is displayed properly but without the site mission. Effectively this means that mission can only be displayed in main site language.

regards
Blackjam

Comments

sungkhum’s picture

I also would like to see a solution to these problems - especially the mission statement.

-Nathan
http://www.sbbic.org/drupal-4.7.0/

sungkhum’s picture

I found out the answer to the mission statement problem (and having different site titles for each language).

http://drupal.org/node/65271

Basically add this to /sites/default/settings.php

$conf['i18n_variables'] = array(
        // Site configuration
        'site_name',
        'site_slogan',
        'site_mission',
        'site_footer',
        'anonymous'
);

The best place to put it is right after some other code (otherwise if you are not careful it will be commented out).

Once you add that, just go to the admin and system settings in each language and change the things you want - they will be saved for that language only!

I wish this was made a little more clear for people like me...maybe I will make a guide, since all the helps out there are for "techys"

-Nathan
You can check it out here:
http://www.sbbic.org/drupal-4.7.0/

Next, I am going to figure out how to get the language links out of the languages block...

blackjam’s picture

Unfortunatelly this doesn't solve the problem. I have that code snippet in my config and I am able to store site mission in 2 languages - I can see it in admin pages.

But I am not able to DISPLAY the mission in 2 frontpage variants. I am sure it must be something trivial, but both site.com/cs and site.com/en show frontpage WITHOUT mission. Probably the code which decides to show mission is incorrect.

mathieu’s picture

Just to keep this alive & current ...

I installed a most recent (June 3rd) version of i18n module and I have the frontpage bug, where the site_mission isn't translated.

I had a look at the code, but I'll have to look again and for a lot longer to find anything usefull... maybe next weekend.

Mathieu

mathieu’s picture

Version: master » 4.7.x-1.x-dev

Just checked ... this (at least the problem with the mission statement) is in 4.7 version as well.

jose reyero’s picture

I have the same setting as sungkhum in my site and it works, http://www.reyero.net

Please, review your settings and make sure you have set up a value for each language, in the settings pages.

omar’s picture

I have setup i18n as instructed, added the variables to settings.php and provided values for my two translations... this approach used to work for me (and apparently is currently working for Jose) but I too am experiecing the problem with the mission statement.

lennart’s picture

I can confirm the problem with the mission statement.

asiafan’s picture

this problem about going back to default language homepage is reported many times (eg. http://drupal.org/node/70547), i just checked reyero.net and it has it too. when i go to e.g. http://www.reyero.net/en/node/128 (non-default EN language page) and click the site title or the breadcrumb home link they go back to reyero.net with default spanish page even though i was on an english one. language should be kept even when returning to the front page (and I dont mean separate front pages or front page module, i mean /en/node or en/node)

lennart’s picture

the problem with the mission statement has to do with the template system

lennart’s picture

even with 'site_frontpage' in the settings.php under the language variables I cannot seem to get one front page for each language and thus not independent mission statements.

lennart’s picture

Jose - are you using the phptemplate theme engine ?

jose reyero’s picture

No, I'm not using phptemplate and yes, it could be related with the templating system, maybe with how it checks for the front page..

About the link from the logo, this is usually kind of hardcoded in the theme and there isn't too much we can do about it without patching Drupal core...

Anonymous’s picture

Yes, it is indeed a problem caused by the way drupal checks if the page is the front page: it doesn't care about language extensions. The mission statement is only showed on the front page.

Adding this in template.php solved the problem for me:

function  _phptemplate_variables($hook, $variables) {
	switch($hook) {
	    case 'page' :
 	$currentpage = drupal_get_path_alias($_GET['q']);
	$frontpage = variable_get('site_frontpage', 'node');
	if ($currentpage == $frontpage or $currentpage==$GLOBALS['locale'].'/'.$frontpage) {
	    $variables['is_front'] = true; }
	break;
  }
  return $variables;
}

Inspiration came from here: http://drupal.org/node/44510 – I just didn't wanted to edit phptemplate.engine.

lennart’s picture

Unfortunately this does not seem to work for me - are you on Drupal 4.7.2 ?

lennart’s picture

I got it! Combining the above and changing path.inc line 200 to:
return $_GET['q'] == variable_get('site_frontpage', 'node');

mathieu’s picture

I just had a look and it's been fixed in cvs. Hopefully this will find it's way in 4.7.3...

omar’s picture

I can confirm that the solution in #16 solves the problem.

Thanks

mathieu’s picture

Status: Active » Fixed
ap’s picture

The solution in #16 WITHOUT the code in #14 works for me. i.e. only the change to path.inc.

Can this be correct?

lennart’s picture

If it works - it works!

capt.foz’s picture

Sorry if this feels like a stupid question... I have this problem of front page not matching selected language but only the default one and found possible solutions here. Here is the stupid question: I am loong for this template.php file to apply the code found in #14 but I can't find it anywhere, Where would it be? I looked into settings.php and the path seems to be ok.

Sylvain

mathieu’s picture

Have a look here...

astra’s picture

I am using drupal 4.7.2.

For me the solution in #16 without code in #14 can solves the problem about the site mission on the frontpage.

But the problem still exists about going back to its own frontpage from different language pages. It always go to the English frontpage as clicking the site logo, or the site name of any other language, or breadcrumb home link of any other language.

Any solution for going back to its own language frontpage by click site logos, or site names, or home links?

Anonymous’s picture

Status: Fixed » Closed (fixed)
onionweb’s picture

Status: Closed (fixed) » Active

Don't think this should be closed because none of the proposed solutions fixes issue #1:

1. Clicking on site name always goes to mysite.com, not to mysite.com/{en|cs} (as it was in 4.6). As a result, clicking on site name means it switches do default language every time. I think is would be better to keep selected language - many people use clicking to site name to navigate to frontpage.

vthirteen’s picture

bringing this up, we dont seem to have any duplicate of this issue.

apparently the rule stated here http://drupal.org/node/70194 doesn't work, at least for who is using phptemplate engine.
"Custom home page for each language
Set up your home page in administer>settings, i.e. 'home'
Define a path alias for each language page. I.e. 'es/home', 'en/home'.... "

the issue can be seen even on the module author's home page: http://www.reyero.net/

jose reyero’s picture

Status: Active » Closed (won't fix)

This version is not supported anymore. Please check out latest ones.