IP.Board 2.3: Allow guests to choose a language
Started by Martin, Jan 30 2008 11:16 PM
24 replies to this topic
#1
Posted 30 January 2008 - 11:16 PM
This is the support topic for the tutorial Allow guests to choose a language. Please post here if you have any questions or feedback.
#2
Posted 31 January 2008 - 07:44 AM
signature said:
Oh, you like it?
I like it! Donation sent to norway!
Was so long looking for a working solution! Cheers and 1k Thx for making the language switch available!
#5
Posted 31 January 2008 - 12:19 PM
m4rtin,
with the dropdown box the language selection works very well.
Do you see any chance that it would work also when a user clicks on the country flags in the header?
Currently it chance the language after the second click.
with the dropdown box the language selection works very well.
Do you see any chance that it would work also when a user clicks on the country flags in the header?
Currently it chance the language after the second click.
Edited by Tom, 11 March 2009 - 12:56 PM.
#6
Posted 31 January 2008 - 11:51 PM
Add "&cal_id=0" at the end of the links
My: Modifications · Tutorials · Twitter

#8
Posted 08 September 2008 - 08:25 AM
Hi m4rtin, I have set the Default Language to '3' (via Look and Feel => make default). I have checked the conf_global.php and it suits (also '3').
WhatI dont understand is why English is still default when i open the forum page as guest? Could it be that i have to change anything else to make it working?
Tia
Tom
WhatI dont understand is why English is still default when i open the forum page as guest? Could it be that i have to change anything else to make it working?
Tia
Tom
Edited by Tom, 08 September 2008 - 08:26 AM.
#9
Posted 11 September 2008 - 04:36 PM
Does anyone else have an explanationwhy switching language (ACP functionality) does not work?
Tia
Tom
Tia
Tom
#10
Posted 15 September 2008 - 04:11 PM
*bump*
#11
Posted 15 September 2008 - 08:04 PM
That weird. When new members register, what's their default language?
My: Modifications · Tutorials · Twitter

#12
Posted 15 September 2008 - 09:01 PM
I've two languages available and want to switch the default language to German.
Unfortunately the ACP Switch does not have any effect what Language Guests are seeing. That is really odd and I have no reasonable explanation why it doesnt work.
Unfortunately the ACP Switch does not have any effect what Language Guests are seeing. That is really odd and I have no reasonable explanation why it doesnt work.
#13
Posted 15 September 2008 - 09:03 PM
You didn't answer my question. If new members have English as their default language, it's a problem with the default files, or any other modification.
If it's German, it's something wrong with this tutorial.
If it's German, it's something wrong with this tutorial.
My: Modifications · Tutorials · Twitter

#14
Posted 07 October 2008 - 07:56 AM
Tom, on Sep 15 2008, 05:01 PM, said:
I've two languages available and want to switch the default language to German.
Unfortunately the ACP Switch does not have any effect what Language Guests are seeing. That is really odd and I have no reasonable explanation why it doesnt work.
Unfortunately the ACP Switch does not have any effect what Language Guests are seeing. That is really odd and I have no reasonable explanation why it doesnt work.
Yep, i have exactly the same problem...
My default language is german (lang_cache/3/)
If i want to change it into english, the page is reloading, and in the drop down i read language is english but my board language is german
Sometimes i read German in the drop down box but my forum language is english in iexplorer?!
My Forum default language is german, but if i log out as guest, my forum is in english language...
#15
Posted 07 October 2008 - 08:41 AM
m4rtin, on Sep 15 2008, 03:04 PM, said:
That weird. When new members register, what's their default language?
m4rtin, on Sep 15 2008, 04:03 PM, said:
You didn't answer my question. If new members have English as their default language, it's a problem with the default files, or any other modification.
If it's German, it's something wrong with this tutorial.
If it's German, it's something wrong with this tutorial.
Some users registering using the english page, some of them are switch to german before the apply for a membership.
(and that the problem: I want to make German as default, but this is not possible - In ACP it tells me default, but browsing as guest to the forum english is still the standard)
#16
Posted 09 October 2008 - 08:36 PM
Alrighty!
I finally managed to find a solution to this!
Open index.php
Find:
I finally managed to find a solution to this!
Open index.php
Find:
//--------------------------------
// Did we choose a language?
//--------------------------------
if ( (isset($ipsclass->input['setlanguage']) AND $ipsclass->input['setlanguage']) AND (isset($ipsclass->input['langid']) AND $ipsclass->input['langid']) )
{
if ( is_array( $ipsclass->cache['languages'] ) and count( $ipsclass->cache['languages'] ) )
{
foreach( $ipsclass->cache['languages'] as $data )
{
if ( $data['ldir'] == $ipsclass->input['langid'] )
{
if( $ipsclass->member['id'] == 0 )
{
$ipsclass->my_setcookie( 'language', $data['ldir'] );
}
else
{
$ipsclass->DB->do_update( 'members', array( 'language' => $data['ldir'] ), 'id='.$ipsclass->member['id'] );
}
$ipsclass->member['language'] = $data['ldir'];
}
}
}
}
Replace with://--------------------------------
// Did we choose a language?
//--------------------------------
if ( (isset($ipsclass->input['setlanguage']) AND $ipsclass->input['setlanguage']) AND (isset($ipsclass->input['langid']) AND $ipsclass->input['langid']) )
{
if ( is_array( $ipsclass->cache['languages'] ) and count( $ipsclass->cache['languages'] ) )
{
foreach( $ipsclass->cache['languages'] as $data )
{
if ( $data['ldir'] == $ipsclass->input['langid'] )
{
if( $ipsclass->member['id'] == 0 )
{
$ipsclass->my_setcookie( 'language', $data['ldir'] );
}
else
{
$ipsclass->DB->do_update( 'members', array( 'language' => $data['ldir'] ), 'id='.$ipsclass->member['id'] );
}
$ipsclass->member['language'] = $data['ldir'];
}
}
}
}
else
{
if( $ipsclass->member['id'] == 0 )
{
if( $ipsclass->my_getcookie( 'language' ) == 0 )
{
$ipsclass->my_setcookie( 'language', $ipsclass->vars['default_language'] );
}
}
}
Save and upload
My: Modifications · Tutorials · Twitter

#17
Posted 10 October 2008 - 02:26 PM
Thank you very much for re-viewing the code m4rtin.
It works now, we have checked this from various sources.
Cheers!
It works now, we have checked this from various sources.
Cheers!
#18
Posted 10 October 2008 - 05:50 PM
Great to have it out of my head
My: Modifications · Tutorials · Twitter

#20
Posted 14 October 2008 - 05:54 PM
Nice one and working as intended
BTW: I have always wondered why IPS never though about adding an option like this at least for the regristration process, where choosing a language is so valuable for boards with more than one language installed.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





Contributor











