Plugins » Multi-Language Manager 1.2.2

Automatic redirect based on browser language
Topic Closed
juergen
1.5K Posts
54.4K Downloads
16 Plugins
design, web development & visual effects

Can't get it working. I've set my browser to only send "de" as HTTP_ACCEPT_LANGUAGE but I will always see the english homepage. The homepage has 3 languages linked  "en", "de" and "fr".

The problem is IMO that the WhichPage filter early exits here

if( !empty($path) ){
    return $path;
}

because $path is already passed to the hook as "Welcome".
If I understand the logic correctly, the audo redirect will only fire at the homepage, which is assumed to be $path=="".
But in my case the $path variable is never empty.

Maybe I just don't get it, how it's supposed to work. Please help.

4 years ago#8711

juergen
1.5K Posts
54.4K Downloads
16 Plugins
design, web development & visual effects

But in my case the $path variable is never empty.

Ok, this doesn't seem to be true.
I "msg()ed" the $path but the page was already redirected by the WhichPage hook.
So it must be sth. different....

4 years ago#8713

Josh S.
2K Posts
283K Downloads
16 Themes
18 Plugins

Sorry, it was broken (as you noticed, $path was never empty)

I just pushed some changes to the git repo.

4 years ago#8714

juergen
1.5K Posts
54.4K Downloads
16 Plugins
design, web development & visual effects

Hmm, in the meantime I got it working by simply commenting out the line

// $config['homepath_key']        = false;
 

Edited: 4 years ago#8715

Josh S.
2K Posts
283K Downloads
16 Themes
18 Plugins

Hmm, yep, that may be more correct than what I did. My changes make it impossible for users to navigate to different homepages.

edit: Just pushed another change to git

Edited: 4 years ago#8717

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register