[Not a JF bug] Lang. prefix doesn't work for def. menu item

This forum contains all bugs reported in beta2 and prior versions. As we already released a new version, we recommend you to upgrade. Support for 2.0 beta versions is discontinued.
Forum rules
You can not post new bugs here. Please upgrade to new version, which is already available.
2.0 Beta versions are no longer supported.

[Not a JF bug] Lang. prefix doesn't work for def. menu item

Postby rtv on Sun Jul 13, 2008 1:39 pm

Despite using SEF-prefix (Joomla 2.0beta2) the "Home" link points to mydomain.com instead of mydomain.com/sv/, all other links include the sv prefix - is this a bug or am I missing something?

(I'm using 302 redirect and no cookies)
Last edited by rtv on Thu Jul 24, 2008 11:54 am, edited 1 time in total.
rtv
Newbee
 
Posts: 26
Joined: Sat Jul 05, 2008 12:25 am

Re: Bug? Language prefix doesn't work for default menu item

Postby ivo.apostolov on Wed Jul 16, 2008 7:51 pm

This is expected behaviour. Anyway if you try entering mysite.com/sv.html it will open the frontpage in Swedish.
User avatar
ivo.apostolov
Contributor
 
Posts: 3248
Joined: Sat Oct 20, 2007 10:39 am
Location: Sofia

Re: Bug? Language prefix doesn't work for default menu item

Postby rtv on Thu Jul 17, 2008 1:29 pm

Ok, so I must use cookies as well (in addition to 302 redirect)?

The problem is when a user enters mydomain.se (and expects the swedish web page) he/she gets redirected to mydomain.com/sv (which will be in swedish), but if the user then clicks the default menu item he might see an entire different language based on the browser settings. Isn't the point of using 302 redirect that cookies shouldn't be needed? Once the language has been determined (either through cookie or url/subdomain) shouldn't the language stick with the user unless he/she purposely changes the url/language?

If the behavoiur is supposed to work as you describe, I must say it seems a bit strange; it would be like going to http://sv.mydomain.com/ and when clicking the default menu item get redirected to http://mydomain.com/ (which I suppose don't happen).

By the way, thanks for a great component and all your hard work! :)
rtv
Newbee
 
Posts: 26
Joined: Sat Jul 05, 2008 12:25 am

Re: Bug? Language prefix doesn't work for default menu item

Postby rtv on Tue Jul 22, 2008 8:18 am

Do you (or Geraint perhaps) know where I can fix this, since in my opinion the "expected behaviour" is incorrect?
rtv
Newbee
 
Posts: 26
Joined: Sat Jul 05, 2008 12:25 am

Re: Bug? Language prefix doesn't work for default menu item

Postby ivo.apostolov on Wed Jul 23, 2008 1:17 pm

Well, you didn't mention preliminary that you were using 302 redirect.
User avatar
ivo.apostolov
Contributor
 
Posts: 3248
Joined: Sat Oct 20, 2007 10:39 am
Location: Sofia

Re: Bug? Language prefix doesn't work for default menu item

Postby rtv on Wed Jul 23, 2008 4:40 pm

I thought I did:
(I'm using 302 redirect and no cookies)
:?
rtv
Newbee
 
Posts: 26
Joined: Sat Jul 05, 2008 12:25 am

Re: Bug? Language prefix doesn't work for default menu item

Postby rtv on Thu Jul 24, 2008 11:52 am

This is not a Joom!Fish bug, I apologize for any inconvenience.

The behavior is defined in the Joomla Core (mod_mainmenu).

To keep the language prefix for the default menu item as well, change the following:

In modules/mod_mainmenu/helper.php on row 351, replace:
Code: Select all
$tmp->url = JURI::base();

to
Code: Select all
$tmp->url = str_replace(array($tmp->route.'/', $tmp->route), '', JRoute::_( $tmp->url ));


I'm not sure this works in all cases, but it solves my problem. If SEF is off, the link will point to /index.php?component=com_pa_content&view=frontpage (or your specified target), which some might think is ugly - but I use SEF on so it's not a problem :).

Edit: Corrected the code
Last edited by caro84g on Sat Feb 06, 2010 5:21 pm, edited 4 times in total.
Reason: corrected row number to Joomla 1.5.15
rtv
Newbee
 
Posts: 26
Joined: Sat Jul 05, 2008 12:25 am

Re: [Not a JF bug] Lang. prefix doesn't work for def. menu item

Postby Geraint on Thu Jul 24, 2008 6:50 pm

Thanks for the insight.

Another possible solution is to use the subdomain approach to language determination then the redirect would go to http://en.domain.com or http://fr.domain.com etc.

Geraint
Joomfish club members can get priority forum support at the Support Forum. As well as access to a variety of custom Joomfish addons and benefits.

Join the Joomfish club today!
Geraint
Contributor
 
Posts: 2920
Joined: Sat Oct 20, 2007 9:13 am

Re: [Not a JF bug] Lang. prefix doesn't work for def. menu item

Postby rtv on Fri Jul 25, 2008 8:43 am

I just corrected the code above, my previous try didn't work.
rtv
Newbee
 
Posts: 26
Joined: Sat Jul 05, 2008 12:25 am


Return to Beta, Beta 2 and prior version bugs

Who is online

Users browsing this forum: No registered users and 1 guest