vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Mini Mods - Set forum-language automatic to browser-language for first-visitors (https://vborg.vbsupport.ru/showthread.php?t=129081)

JoergZ 10-13-2006 10:00 PM

Set forum-language automatic to browser-language for first-visitors
 
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 part of automatic-detection of the browser-language was realised by WildChild


Requirements
  • vB 3.6 (Tested with 3.6.2)
  • Of course more than one installed and selectable language, otherwise this modification makes no sense ;)
Installation-time

about 1 minutes


PLEASE CLICK THE INSTALL BUTTON IF INSTALLED! :)


------------------------------------------------------------------------

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

Klaymen TK 10-14-2006 05:38 PM

Really really great! Thanks man!

*Installed*

Robru 10-14-2006 07:12 PM

Marvelous hack, thank you :)

Ajavas 10-15-2006 03:55 PM

Thanks nice modification. :)

**Installed**

oberheimhaven 10-15-2006 10:40 PM

will this work 3.6.0 thxs m8 great hack also i couldnt find her after install to check her in adminp
thxs
MArkAnthony

nope nothing?? Im missing something here correct??

JoergZ 10-16-2006 04:56 AM

I have not tested it with 3.6.0, but it works for all 3.5.x versions and for 3.6.2, so it should work for 3.6.0 and 3.6.1 too.

After you have installed the plugin, there will be not new points in the settings. You have to go to the plugin-area and edit the plugin-code direct. So click on "Plugins & Products" in the left menue in the Admin-CP, then select "Plugin Manager".

There you click on "Edit" at the plugin "Set automatic forumlanguage to browserlanguage". To have a better overview increase the size of the edit-box 3 or 4 times. Scroll to the end of the plugin-code. There you find direct above the edit-description the lines, where you can assign the language-code to your language ID.

If you still have problems to find it, I can provide some screenshots.


Best regards

J?rg

oberheimhaven 10-16-2006 09:59 AM

Quote:

Originally Posted by JoergZ
I have not tested it with 3.6.0, but it works for all 3.5.x versions and for 3.6.2, so it should work for 3.6.0 and 3.6.1 too.

After you have installed the plugin, there will be not new points in the settings. You have to go to the plugin-area and edit the plugin-code direct. So click on "Plugins & Products" in the left menue in the Admin-CP, then select "Plugin Manager".

There you click on "Edit" at the plugin "Set automatic forumlanguage to browserlanguage". To have a better overview increase the size of the edit-box 3 or 4 times. Scroll to the end of the plugin-code. There you find direct above the edit-description the lines, where you can assign the language-code to your language ID.

If you still have problems to find it, I can provide some screenshots.


Best regards

J?rg

Ok I found what are we suppose to do to get this to work tho????? I have installed is there suppose to be a drop down menu? anything I aint getting it??

uspange 10-16-2006 11:30 AM

Quote:

Ok I found what are we suppose to do to get this to work tho????? I have installed is there suppose to be a drop down menu? anything I aint getting it??
1.) Open Admin Panel
2.) Check Languages (with my board German is ID1 and English ID2)
3.) Go Plugins & Products
4.) Manage Plugins
5.) Click "edit" for "Set automatic forumlanguage to browserlanguage"
6.) Check code at the end. If you only run German and English, you might want to delete French or set it to German/English.

Do your testing with your browser, delete cookies and stuff ...

JoergZ 10-16-2006 05:39 PM

Quote:

Originally Posted by oberheimhaven
I have installed is there suppose to be a drop down menu?

No, there is no visible change. Please look at the top, there is the short-description what this hack do.

To give an example:

You have installed the following languages on your board: English, German, French.

A visitor, that has never been bevore on your forum comes to your website with the board. Without any modification the user see the board in the language, you have defined as default. Let's say English. To change the language the user has to select it from the drop-down menu at the bottom.

With this hack, a first-time visitor from France would see the board immedeately in French, without changing the language manually.

That's what the hack is doing.

How you set the hack correct to the languages you have installed, is described in the downloadable installation-description.

How to get there, has uspange described in the post above very good.


BR

J?rg

oberheimhaven 10-17-2006 02:03 AM

thxs mates great hack!!!!1

Greek76 10-18-2006 08:39 AM

I installed but doesnt seem to work. Where it says x or xx I forget I replaced it with the language I would like. I added tha language on my browser did what you said but no good. Any ideas?

JoergZ 10-18-2006 08:54 AM

Hi Greek76 !

The only idea I have is the following: After you have added a different language-preferenz to your browser, have you changed the order, so the new language is on top ?

And it is important, that you logout from your board, and do not click anything after logging out, otherwise again a cookie would be set. So logout, and then close the browser window, then start your browser again.

What browser are you using ? I admit, I have tested it only with IE 6.0. But it should work with all browsers.

Best regards

Jörg

lapinkulta 10-19-2006 01:38 PM

wonderfull hack, very usefull.

one question: can i assign a specific style together with the language? will this work also for guests or for users only?

greetings,
lapinkulta

JoergZ 10-19-2006 05:06 PM

Quote:

Originally Posted by lapinkulta
one question: can i assign a specific style together with the language? will this work also for guests or for users only?

Never thought about that. I will check this. If it works, then it would be also only for first-time visitors with no cookie. The user is always able to change the style.


BR

J?rg

lapinkulta 10-19-2006 06:44 PM

yes, would be nice for replacement variables in different languages. i am using something like that which works only for logged in users, not for guests:

Code:

if ($_SERVER['HTTP_HOST'] == "en.domain.com") {
                                $_REQUEST['langid'] = 3;
$_REQUEST['styleid'] = 4;
                } elseif ($_SERVER['HTTP_HOST'] == "de.domain.com") {
                                $_REQUEST['langid'] = 2;
$_REQUEST['styleid'] = 3;
                } else {
                                $_REQUEST['langid'] = 16;
$_REQUEST['styleid'] = 5;
                }


localrelax 12-22-2006 12:48 PM

Thanks, it works on 3.6.4

domainsTRADER 12-27-2006 06:36 AM

tanks nice idea

bjhuang 06-06-2007 06:50 PM

can not change language settings from control panel after installed.

zhaoke 10-12-2007 09:47 PM

This sounds great, but it not works on 3.6.8, the below is my settings:
(i checked language code settings, zh-cn_id: 11, en-US_id: 1)

$_DLANG='en-US';

'en-US', # english.
'zh-cn' # chinese.

case 'en-US':
$_REQUEST['langid'] = 1;
break;
case 'zh':
$_REQUEST['langid'] = 11;
break;

Kirauni 11-02-2007 08:30 PM

*installed this add-on*

It works fine on my vBulletin 3.6.8.
However, I had to delete all my browser's temporary files, cookies etc.
Right after this I switched my browser's language and then it worked perfectly.

Thank you very much for this nice hack, it makes browsing a multilingual board as a guest much easier.

JAnders 02-15-2008 06:08 PM

I just installed it in version 3.5.8 the xml didn't work but I made a simple modification to the xml reuploaded and worked no problem.

if anyone wants this mod and can't get it to work in v 3.5 i can give you the moded xml

btw thanks for the hack it was exactly what I was looking for

masterweb 02-15-2008 06:40 PM

it works on 3.6.8 with a custom style?

JoergZ 02-15-2008 07:22 PM

Quote:

Originally Posted by JAnders (Post 1443898)
I just installed it in version 3.5.8 the xml didn't work but I made a simple modification to the xml reuploaded and worked no problem.

if anyone wants this mod and can't get it to work in v 3.5 i can give you the moded xml

btw thanks for the hack it was exactly what I was looking for


The change was not necessray, because there is a 3.5 Version too.

Moreover it would have beend nice to ask me before you offer your modified version to others ;)




Quote:

Originally Posted by masterweb (Post 1443920)
it works on 3.6.8 with a custom style?

The style doesn't matter.



J?rg

yeku 02-16-2008 01:41 AM

My forum is in Spanish, does this hack not work?

thank

JoergZ 02-16-2008 07:58 AM

To give you some help I need more information. Which languages do you have installed ? Is the board public where you have installed the hack ? If so, then please send me the link via PM, so I can have a look on your site.

Jörg

yeku 02-16-2008 02:36 PM

Ok Jörg:

My forum is in English, the base. I have translated text into Spanish, I do not have once no hack of language was installed.

Thanks

JoergZ 02-16-2008 03:35 PM

Hi yeku !

It is not a good idea to post user and pw public. :) I changed the password of the user.

As far as I see, you don't offer different languages to choose. But that's a condition for using the hack.

You have to install different language-packages and have to make them user-selectable. Then the hack will automatic change to the fitting language for guest.

J?rg

yeku 02-16-2008 04:12 PM

Hello!!!

No matter, himself I do that, I have the controlled theme, in any case thanks.

I will install several hack of languages

thank

Fraxter 05-26-2008 09:17 PM

Can anyone update this great addon to vbulletin 3.7? It?s not working for me there. :(

JoergZ 05-27-2008 07:57 PM

I am sorry, but currently I have no time to work on hacks.

If anyone want to modify this hack, so it works with 3.7 ,feel free to do it.


Best regards

Joerg

bongwater 06-24-2008 05:35 PM

seems to work fine for our forum, and we are on 3.7.2

JoergZ 06-24-2008 05:41 PM

Nice to hear.

Then Pander23 maybe did something wrong.. ;)


Joerg

Datenpapst 02-18-2009 07:24 AM

Fatal error: Cannot redeclare rk_getenvvar() (previously declared in /var/www/vhosts/c-arena.com/subdomains/forum/httpdocs/includes/init.php(298) : eval()'d code:63) in /var/www/vhosts/c-arena.com/subdomains/forum/httpdocs/includes/init.php(298) : eval()'d code on line 266

is coming when I install this on 3.8.1

JoergZ 03-02-2009 08:11 AM

Sorry, as you can see in the top, it is only tested and approved up to 3.6.2

Due to lack of time, I have currently no plans to bring it to 3.8.x. Sorry

Best regards

Joerg

snoopy5 06-20-2009 05:59 AM

Hi

could anybody adjust this great mod for vb 3.8x?

Or does anybody knows a similar hack. I absolutely need this automatic browser language detection!

snoopy5 06-29-2009 12:00 PM

FYI

I tested this now on a vb installation version 3.80 and 3.83. It works in both of them. I have not seen yet any errors or incompatibilities.

Great mod!

JoergZ 06-29-2009 12:51 PM

Hi snoopy5,

thank you very much for your feedback. I am lucky to hear it is working with 3.8


Joerg

snoopy5 06-29-2009 03:28 PM

Hi

I tried it now on a third installation, but it seems that I tried accidentally to upload it twice. Now I get an error.

I disabled all plugins in config.php, so that I have access again the ACP.

But how do I delete this plugin now properly, so that I can try to install it again?

snoopy5 06-29-2009 03:51 PM

update:

I found it. It was under a different section of the plugin options within ACP.

So I deleted it and installed it again. This time no error. BUT it does not recognize the browser language and I do not know why. The settings are the exact same as with the other 2 installations.

What could be the reason for this? I deleted already in FF cookies etc.

snoopy5 06-29-2009 04:28 PM

update:

I found it. It was under a different section of the plugin options within ACP.

So I deleted it and installed it again. This time no error. BUT it does not recognize the browser language and I do not know why. The settings are the exact same as with the other 2 installations.

What could be the reason for this? I deleted already in FF cookies etc.


All times are GMT. The time now is 08:34 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01439 seconds
  • Memory Usage 1,820KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete