![]() |
|
Mod Options |
![]() |
|||||||||||
Set forum-language automatic to browser-language for first-visitors
![]() Developer Last Online: Dec 2012 ![]() ![]() ![]() This modification is in the archives.
Originally I have not planned to bring my Hack "Language Selection for Guests" to vB 3.5, because in 3.5 the language can be selected with the drop-down menu at the bottom.
But I was asked to make the automatic language-detection in 3.5 available. In case others are maybe interested in that too, I bring it here as new hack for vB 3.5 Short-description This Hack detects the browser-language automatic and shows the board in the language of the user, if the user has never been at your board before or has no cookie for your board. The automatic-detection of the browser-language was realised by WildChild Requirements
about 1 minutes PLEASE CLICK THE INSTALL BUTTON IF INSTALLED! ![]() Updates 01.10.2005 Thanks to the help of KirbyDE, now a standard-hook is used, so no code-modification is necessary ------------------------------------------------------------------------ If you want to test the hack after installing, do it like this: - Log out of your forum. Dont klick any of the displayed links after logging out ! - Close your browser-window - Open a new browser-window - Set your language preferences in the browser - Go to your forum homepage Download Now Only licensed members can download files, Click Here for more information. Show Your Support
No members have liked this post.
|
![]() |
||||
Mod | Developer | Type | Replies | Last Post |
Mini Mods Set forum-language automatic to browser-language for first-visitors | JoergZ | vBulletin 3.6 Add-ons | 47 | 24 May 2010 14:14 |
Comments |
#2
|
||||
|
||||
Optimization suggest: get rid of the File edit
![]() Hook init_startup, and use $_REQUEST['langid'] instead of $vbulletin->GPC['langid'] in the Code No members have liked this post.
|
#3
|
|||
|
|||
Thanks for the hint KirbyDE, but what is with $vbulletin->GPC[COOKIE_PREFIX . 'languageid'] ? How to replace that ?
Just replacing the GPC['langid'] is not working. Jörg No members have liked this post.
|
#4
|
||||
|
||||
$_COOKIE[COOKIE_PREFIX . 'languageid']
No members have liked this post.
|
#5
|
||||
|
||||
question...
does the use have the option to change the language after its "autodectected"? or is it "stuck" on the one it detects? (I HATE that.) aside: Hate when sites do that....can't change it back to english once its detected im in Korea or Japan or whereever). Sorry just had to vent. ![]() ![]() sounds cool as long as user can freely change and it only affects first time (non-cookied) visitors. No members have liked this post.
|
#6
|
|||
|
|||
No, of course the user can change it.
This automatic detected language is only used, as long the user don't select another one or he has a cookie from an earlier vist. So it is really for users, that come the first time to your site, or has logged out, so the cookies were deleted. When the users select another language, the selected language is taken and is not switched back to the automatic detected, because then there is an entry in the cookie. Currently I am trying to use the standard-hooks, so no code-changes are needed at all. Maybe this evening there is an update for my hack. Jörg EDIT: I have updated the hack, so no more code-modification is necessary. Thanks very much to KirbyDE for his help. No members have liked this post.
Last edited by JoergZ; 01 Oct 2005 at 12:11. |
#7
|
|||
|
|||
Jörg, your hack works great, as well as the old version with new hook. You can check it on the my test forum http://temp.ulver.com
Just one thing to do. When you logg-in with one language (for example norwegian) and then change this language to another (for example swedish), after logg-out you lost your norwegian and return to swedish. But could we stay with swedish anyway, even after logg-out? No members have liked this post.
|
#8
|
|||
|
|||
Originally Posted by Fenriz
Hm.. your description is a little bit mixed up.. isn't it ?
![]() Probably you mean: - Arriving at the forum, it is Norwegian, log in - Changing as logged-in-user to Swedish - Logging out --> You have again norwegian, but you want to keep Swedish Unfortunally this is not possible, because the language-information is stored in the cookie. When you log out, the cookie is removed. So coming back to the forum without cookie, will start the auto-detection process again. The only way to keep the language, is not to log out, so the cookie remains. Then you will have the same language, as you left the forum. But usually this should not be an issue, because users probably have their preferred language in the IE-Settings. If the language, they have defined in the IE, is not installed in your board, then the default-language of the board is shown. Best regards and hej då ![]() Jörg No members have liked this post.
|
#9
|
|||
|
|||
Hello, wouldnt it here possible to add the possibility to set language depending of forumid ?
(by the way, thanks a lot... that will make more members)
__________________
International Forum No members have liked this post.
Last edited by berberber; 03 Oct 2005 at 14:51. |
#10
|
|||
|
|||
Hi berberber,
I don't know if this would make sense... At least the user has one language, he preferes, and that is the language, that is set in the IE. So why the language should change, when I change the forum ? Moreover, I think this must be hacked at another point of the code, not where my hack is placed. Jörg No members have liked this post.
|
#11
|
|||
|
|||
yes, but Search engines, have no language set, and some Browsers not as well, so it would make sense for me, that in first place, it would depend on users choice, but then, on forum admins choice.
For example on my forums, i Have a french area, I would like to be seen like french as default. KirbyDE already said its not possible via plugins, I tried, but did not get it. Bernhard
__________________
International Forum No members have liked this post.
|
#12
|
||||
|
||||
Originally Posted by JoergZ
cool!!
<< installed. thanks!! ^^ No members have liked this post.
|
#13
|
|||
|
|||
Thank you, great idea. I just installed this, however it seems to have a glitch:
My Borwser language is set to EN-US & En (in Firefox) and to En-Ca in IE. When i go to the forum without a cookie set (logged out), then the forum language auto-sets to Spanish - Mexico. The forums' Default Language is EN-US and it has following language packs installed: Chinese, Chinese-TW, German (Du & Sie), English-US (Default), Spanish - MX and Polish - PL Any ideas? No members have liked this post.
|
#14
|
|||
|
|||
Hello, are you sure you set it correctly up, just edit the plugin, in the plugin manager, to make sure you set the right languageids.
__________________
International Forum No members have liked this post.
|
#15
|
||||
|
||||
@betablue: Did you checked the code in the plugin, that all language-assignments are correct as berberber wrote ?
For detecting EN-US, you need e.g. an entry like this:
X must be replacced by the language-id in your forum. The same you must do for all other languages that you want to have detected and assigned to an installed language. I will test it with en-us setting in Explorer at the weekend, when I am back at home. Jörg No members have liked this post.
Last edited by JoergZ; 06 Oct 2005 at 21:50. |
![]() |
«
Previous Mod
|
Next Mod
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Mod Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 13:51.