hello,

2 languages: en & de
de is default

my selected language is de - now: if i logout as a authenticated user i'm redirected to the frontpage.
but not to the de frontpage - always to www.front.xx/en
and i have no chance to switch to www.front.xx.

is something wrong in my configuration?

i18n 5.x-2.x-dev
drupal 5.7

it's on a production site - so you have got a fast idea :)

thanks and greetings

Comments

momper’s picture

i should complete - my frontpage is:

www.example.xx/blog

lisa’s picture

Under admin->Site Configuration->Site Information did you set the default front page for each language?

That is when you are logged in and have selected DE as your language, navigate to admin->Site Configuration->Site Information and set your default front page as de/node/1 (or whatever the path is for the front page you want for DE). Save the configuration.

Then switch your language preference to EN, and again navigate to admin->Site Configuration->Site Information and set your default front page as EN/node/2 (or whatever the path is for the front page you want for EN). Save the configuration.

Hope this helps.

momper’s picture

Title: redirect after logout/login to the wrong language » redirect after logout to the wrong language

thanks - but something is not working ...

if i put as frontpage as multilanguage-variables

in de: http://www.example.eu/de/blog
in en: http://www.example.eu/en/blog

i get an error-page of the server that says something about a circle ...

if i put only http://www.example.eu/blog as frontpage for both languages it works fine - but: if i logout i always switch to the english version ...

i have no idea - and it took me one day of research ...

greetings momper

momper’s picture

and sometimes if i want to logout i have to do it twice ???

lisa’s picture

In your first post you wrote:

my selected language is de - now

Do you mean you set your default language in your personal user account (under "my account" link in the main nav)? That only affects the default language for you when you are logged in.

Or did you go to admin->site configuration->localization and select de as your default language? If you set it there, then de should be the default language when you are logged out. I don't know what else could be causing it.

I haven't experienced the double log out issue.

giorgosk’s picture

Has anyone resolved this ?

I have the same problem

default language Greek
first page of site comes up in Greek
when user in greek and logs out redirected to the english section

sounds more like a bug to me
but is it i18n or is it the core ?

giorgosk’s picture

Title: redirect after logout to the wrong language » redirect after logout/login to the wrong language

DIRTY Hacks to anyone who is interested in temporary solution

all changes in user.module for luck of a better solution
changes are commented in the code with "HACK"

<?php
function user_logout() {
  global $user, $locale; //HACK: added $locale

  watchdog('user', t('Session closed for %name.', array('%name' => $user->name)));

  // Destroy the current session:
  session_destroy();
  module_invoke_all('user', 'logout', NULL, $user);

  // Load the anonymous user
  $user = drupal_anonymous_user();

  drupal_goto($locale); //HACK: added $locale
}
?>
<?php
function user_login_block() {
    global $locale;  //HACK: added this
  $form = array(
    '#action' => url($_GET['q'], "destination=" . $locale ."/front" ),  //HACK: changed this line
    '#id' => 'user-login-form',
    '#base' => 'user_login',
  );
....
?>
<?php
function user_login($msg = '') {
  global $user, $locale; //HACK: added $locale

  // If we are already logged on, go to the user page instead.
  if ($user->uid) {
    drupal_goto($locale.'/user/'. $user->uid);  //HACK: added $locale
  }
  
  // Display login form:
  if ($msg) {
    $form['message'] = array('#value' => '<p>'. check_plain($msg) .'</p>');
  }

  //HACK: assigned action and base attibutes to the form
  $form = array( 
    '#action' => url($_GET['q'], "destination=" . $locale ."/front" ),
    '#base' => 'user_login',
  );

...
?>

Should this be posted in the CORE issue tracker ??

Athaclena’s picture

Title: redirect after logout to the wrong language » redirect after logout/login to the wrong language

I think I've found out a fix to this in the i18n module or an extra module (if you don't want to hack i18n).
In line 258 of i18n (5.x-2.4) is the function i18n_user.
Just add some logout code as well as the login code:

if($op == 'logout') {
$lang = i18n_get_lang();
drupal_goto(i18n_frontpage($lang));
}

It works for me, the redirect idea is from here http://www.computerminds.co.uk/drupal-redirect-after-logout

My site is only English/Hebrew, this just keeps you in the same language you were in before logging out. Should work with more languages and whether or not the user has chosen a default language...

If this works for others too maybe someone could submit a patch or something? I don't know what to do further or how.

Rachel

jose reyero’s picture

Status: Active » Closed (fixed)

Cleaning issue queue for old versions. If you want to get any support consider using the forum or updating to 6.x.

See #626858: Internationalization 5.x Maintenance Policy. Approaching end of support.