Integration SMF and Mambelfish/Joomfish : How to switch language ?

Started by sinnys, March 01, 2005, 05:43:27 AM

Previous topic - Next topic

mambo dancer


I see. Well, I might give it a try and test it on Mambo 453h.




cferd

Thank you Pax for that info. I didn't realize that.
I guess I'll disable the 'user-selectable' option for now.

Ayayay. Never mind. I can't do that, or it doesn't work at all.

MadPax

yeppers cferd,

I'm banging my head on this one too. Only way I think this could be solved is to somehow have the user's default language in his profile be defined by the system upon his registration.

If smf goes to the extent of sending the registration acceptance e-mails in the languages the user was viewing the site with how hard could this be to implement. What I do not know is even where to start lookng to resolve this issue. lol

smeallum

Quote from: MadPax on March 19, 2006, 09:31:37 PM
OK!

HERE WE GO. Joomfish 1.7 can be made SMF 1.1 RC2 aware as well.

Here's what you got to do.

find the file: /yoursite/modules/mod_jflanguageselection.php

in function _createHRef( $iso ), just before the end of it you find:

return sefRelToAbs( $href );

IMMEDIATELY
before this return instruction insert the following code:

if( $iso=='en' ) $smflang .= "&language=english";
        elseif( $iso=='pt' ) $smflang .= "&language=portuguese";
        $href.= $smflang;

and do as many elseifs as you need.

New final code would look like this:
Quoteif( $iso=='en' ) $smflang .= "&language=english";
elseif( $iso=='pt' ) $smflang .= "&language=portuguese";
$href.= $smflang;
   
return sefRelToAbs( $href );

Enjoy!


Hi, i hope that anybody that participated in this post is still reading this. I just tried this solution for my Joomla 1.0.10, SMF 1.1RC2 and JoomlaHacks bridge. I did the forementioned hack in mod_jflanguageselection and it does work, both as a guest or logging in from Joomla's CB Login.

However, the extra variable keeps on being added in the address bar. Right now i can only see this to be a cosmetics problem, if the users would keep on choosing the language again and again... the url keeps on growing.

Is this expected of this hack or something might be done to avoid the url from growing.

What i mean is that the url shown in the browser's address bar is like this after a few clicks in the language selector:

http://www.m.com/indeysite.php?option=com_frontpage&Itemid=1&language=english&language=spanish&language=english&language=spanish&lang=en_US&language=english [nofollow]

:D

Cheers,
NiCo

orim

Hi Nico,

To prevent the "language=" to be stacked again and again in the URL, you have to patch another line in mod_jflanguageselection.php:

Near the beginning of function _createHRef() (around line 150) you willl find the code:
list($key, $value) = explode( "=", $var);
if( $key != "lang") {
if( $hrefVars != "" ) $hrefVars .= "&";
$hrefVars .= "$key=$value";
}


Replace it with:
list($key, $value) = explode( "=", $var);
if( $key != "lang" && $key != "language") {
if( $hrefVars != "" ) $hrefVars .= "&";
$hrefVars .= "$key=$value";
}


That should solve your problem.
Ori.

smeallum

Orim thank you very much...it worked perfect  ;)

Cheers,
NiCo

BadCluster

can anyone help with this?

when i try to open an attachment i get to the frontpage.

I have smf 1.1.1, Joomla 1.0.12 with Joomfish.

ever heard anything like this?

see for urself from here

http://www.kitespot.gr/component/option,com_smf/Itemid,114/topic,31.msg80/topicseen,topicseen

i think that joomfish does it,
when i try to open the attachment url myself which is this:

http://www.kitespot.gr/forum/index.php?action=dlattach;topic=31.0;attach=6

i paste it and open it in my browser and then i get this url automatically changed to

http://www.kitespot.gr/component/option,com_smf/Itemid,114/lang,gr/?action=dlattach;topic=31.0;attach=6

which leads me to the main page of the forum

I need a hack to make joomfish not to get involved when it come with the forum

Orstio

Part of your problem is here:

http://forum.joomla.org/index.php/topic,118039.0.html

The rest, I can't say.  I was able to download the attachment in that topic just fine.

BadCluster

yeah, in the mid time i found out what was the real problem.
I user a rederiect command in my htaccess,
for /forum/index.php to the bridged url....

so when someone to download an attachment that has a real url it redirected to the above.
So i just removed this rule, of course now i have my forum open to direct access and i
dont know how to avoid this


BadCluster


fuaank

Quote from: MadPax on March 19, 2006, 09:31:37 PM
OK!

HERE WE GO. Joomfish 1.7 can be made SMF 1.1 RC2 aware as well.

Here's what you got to do.

find the file: /yoursite/modules/mod_jflanguageselection.php

in function _createHRef( $iso ), just before the end of it you find:

return sefRelToAbs( $href );

IMMEDIATELY
before this return instruction insert the following code:

if( $iso=='en' ) $smflang .= "&language=english";
        elseif( $iso=='pt' ) $smflang .= "&language=portuguese";
        $href.= $smflang;

and do as many elseifs as you need.

New final code would look like this:
Quoteif( $iso=='en' ) $smflang .= "&language=english";
elseif( $iso=='pt' ) $smflang .= "&language=portuguese";
$href.= $smflang;
   
return sefRelToAbs( $href );

Enjoy!

I tried your solution and could not get it to have any effect. I see no change in URLs as a result of this hack and SMF continues to show in its default language regardless of the joomfish setting.

Are there perhaps any incompatibilities of this hack with joomla standard SEF? does its functioning depend on using the integration mode of the joomlahacks bridge (wrapped/not wrapped)?

I am using:
joomla 1.0.12
jsmf 2.0.2
smf 1.1.2
cb 1.0.2

Thank you in advance for your insight.

Kindred

any modifications listed here on smf.org are unlikely to work with the joomlahacks bridge.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

fuaank

ok, sorry. I confused the two bridges and their homesites. Thank you for explaining.

joseph21

Hello I'm having the same problem..

I added this in modules/mod_jflanguageselection.php:
if( $iso=='en' ) $smflang .= "&language=English";
elseif( $iso=='utf-8' ) $smflang .= "&language=Chinese-Simplified-Utf8";
$href.= $smflang;


before the:
return sefRelToAbs( $href );

and after the:
// if there are other vars we need to add a & otherwiese ?
if( $hrefVars == '' ) {
$href .= '?' . $lang;
} else {
$href .= '&' . $lang;
}


but still the SMF login module stays on the default language defined in SMF.

I'm using Joomla 1.0.12, Ortsios bridge 1.1.7, JoomFish 1.7 and some other mods.

Thanks

EDITED: I'm trying to point out that only the SMF login module will not switch language..

I also added in the modules/mod_smf_login.php:
'utf-8' => 'Chinese-Simplified-Utf8',

after the:
$language_conversion = array(
SMF 1.1.2 (SMF shop-Ad Management), Joomla 1.0.12, Ortsios Joomla - SMF bridge 1.1.7, CB 1.0.2 and many more..

ninoparisi

hi people , i have a very litle problem on my site ....look at hxxp:www.core.org.br/forum/ [nonactive] i just need to translate the word SEARCH on the menu , anybody could help me ????

Kindred

and how is this related to the SMF-Joomla bridge or Mambofish/Joomfish?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: