vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Language-selection for guest (https://vborg.vbsupport.ru/showthread.php?t=59564)

JoergZ 01-02-2004 10:00 PM

Language-selection for guest
 
PLEASE CLICK THE INSTALL BUTTON IF INSTALLED! :)


Hallo,

the vB3 offers the chance to have multi languages, but at the moment it is unfortunally only for registred / logged-in users possible to select a language. Guests / not logged-in users will see always the default language.


With this modification you can offer your guests / not-logged-in users an option to select a language, so they can see the forum and the registration in the selected language. Further the selected language will be set during the registratin as default for the new user.


Short-description

Language-Selection for not logged-in users


Requirements
  • vB3 RC1 or higher (Tested up to 3.0.7) NOTE !! For installation on 3.0.8 or above read this posting !! Thanks to Khashyar for finding this change !
  • Of cource more than one installed language, otherwise this modification make no sense :D
Installationtime

about 5 minutes


The use of this modification is as always at your own risk !


J?rg


Update 05. January 2004 (added version 2)

Update 09. March 2004 (added version 3)

Update 27. March 2004: Tested in 3.0.0 Gold



Version 1:

In this version you have to enter for each language a menue-entry manually

Version 2:

This version detects the selectable languages automaticly and the menue-entries are created automaticly too. To get the menue-entries, the function "Use DHTML Popup Menus" must be activated. This version has an additional query with each page-call. If you don't like this, use version 1.

Version 3:

This version is based on version 1, but it detects the browser-language automatic and shows the board in the language of the user. This automatic-detection of the user-language was realised by WildChild. Thanks for this extension of my hack. Note the difference to my version 2: My Version 2 detects the installed languages automatic, version 3 detects the language which is set in the users browser !



Note: A german version of the installation-instructions you will find here at vbulletin-germany.com


MindTrix 01-03-2004 02:15 PM

Nice and nifty :) Well done mate im sure a fair amount of people will want this :)

Congrats!!

DarkJediKiller 01-03-2004 03:04 PM

Nice Job! My members will love this feature. It might give em a chance to actually LEARN the languages LoL.

Bernd Glasstett 01-04-2004 08:55 PM

That's a nice hack - but I would love to have one more thing: Is it somehow possible to have the installed languages displayed automatically? It's just, that we already have four languages: English, German, French and Luxemburgish - and we will have a fifth soon (Italian). I would love to not have to change the templates for every language again -> /me being lazy ;)

JoergZ 01-04-2004 09:13 PM

Quote:

Originally Posted by Bernd Glasstett
Is it somehow possible to have the installed languages displayed automatically?

Possible is nearly everything... It is always a question of time. ;)

But I don't like the idea not so much. Not because of the time, but such a change would mean you have additionally querys everytime a guest loads the main-page.

For my board I would prefer the template-editing solution instead of having additionally querys. I mean you are not installing a new language every week.. ;)

If you insist upon this automatic, I will see if I have time and if I could manage it.

J?rg

Bernd Glasstett 01-04-2004 09:42 PM

The additional query (should be one) would only be for the guests, right? Well, that should be manageable by the server ;)

JoergZ 01-05-2004 03:48 PM

O.k. I found a solution for you lazy person. :D

You find the update in the first posting.


J?rg

Luciolle 01-05-2004 05:29 PM

Thanks alot for your work and your hack !

It's very good !

Khashyar 01-11-2004 04:40 PM

This is a wonderful hack... thank you for posting it...

I am actually looking for a similar hack for VB2.x...

I have five language templates on my websites vb (www.russianmeetingplace.com/forums), and would like to find a way for users to be able to register in their own language...

I would appreciate if anyone has any ideas..

Thanks,

Khashyar

JoergZ 01-11-2004 06:58 PM

Nice to hear you like my improvement Khashyar.

For vB2, have a look here.

With this hack, you can add a style-seleciton on your forum-home page.


J?rg

Khashyar 01-11-2004 07:21 PM

Thank you, Joerg...

Will that vB2 hack allow users to register in the language that they choose? Or.. will they still need to register in English (or the default forum language?)

Thanks again,

Khashyar

JoergZ 01-11-2004 07:33 PM

I suppose you have solved the multi-language with different styles. With this hack, you can select styles. And I think, if the user have selected a style, the registration will come up in the selected style.

You should try this. Another solution I don't know for vB2.

Jörg

Khashyar 01-11-2004 07:49 PM

Thanks, Joerg...

gmarik 01-17-2004 07:33 AM

Ir could have an autodetect language JavaScript as well ...

Khashyar 01-17-2004 03:46 PM

I didn't need to install the 2.x hack... actually, an admin. at vb.org just gave me a line of text to add to any link code (i.e., "register in German" html link , for example) that allowed people to register in their own language....

Khashyar

tpr 01-18-2004 06:56 AM

Quote:

Originally Posted by JoergZ
PLEASE CLICK THE INSTALL BUTTON IF INSTALLED! :)


Hallo,

the vB3 offers the chance to have multi languages, but at the moment it is unfortunally only for registred / logged-in users possible to select a language. Guests / not logged-in users will see always the default language.


With this modification you can offer your guests / not-logged-in users an option to select a language, so they can see the forum and the registration in the selected language. Further the selected language will be set during the registratin as default for the new user.


Short-description

Language-Selection for not logged-in users


Requirements

vB3 RC1

Of cource more than one installed language, otherwise this modification make no sense :D

Installationtime

about 5 minutes


The use of this modification is as always at your own risk !


J?rg


Update 05. January 2004 (added version 2)

Version 1:

In this version you have to enter for each language a menue-entry manually

Version 2:

This version detects the selectable languages automaticly and the menue-entries are created automaticly too. To get the menue-entries, the function "Use DHTML Popup Menus" must be activated. This version has an additional query with each page-call. If you don't like this, use version 1.


Note: A german version of the installation-instructions you will find here at vbulletin-germany.com


i am not worthy :)

Didi_gt 01-18-2004 06:56 PM

thanks Joerg .....awesome :) http://www.granturismo.de/forums/images/smilies/top.gif

works also in RC2

Bernd Glasstett 02-12-2004 07:46 AM

I have a small suggestion: If you add

Code:

<if condition="$show['registerbutton']">
</if>

around the entry on navbar, noone sees the guestselection, when they are registered and logged in :)

JoergZ 02-12-2004 10:12 AM

If you follow exactly my instructions, it IS like you describe, that the selection-menue-entry is only shown when you are not logged in.

Why ? In my isntruction is written, that you have to look for
PHP Code:

<td class="vbmenu_control"><a href="register.php?$session[sessionurl]">$vbphrase[register]</a></td

and directly after that my code should be added.

So my code is within the condition to show the register-button. --> Language selection is only shown when register-button is shown. And register-button is only shown, when you are not logged in.

So I think, everything is fine... :)


J?rg


P.S. I have not checked RC4 yet. Maybe there were some changes in the navbar template ?


[edit]I have checked this part in RC4 and it still works :) [/edit]

gmarik 02-12-2004 07:51 PM

Could I choose it by the flag .gif icon? Like German, English and Estonian flags on the forumhome top?

JoergZ 02-12-2004 08:03 PM

Yes you can, for this use better the version 1. The link you must use is described in the installation-description.

Jörg

Bernd Glasstett 02-13-2004 09:53 AM

Quote:

Originally Posted by JoergZ
If you follow exactly my instructions, it IS like you describe, that the selection-menue-entry is only shown when you are not logged in.

Ah I know, why I haven't done this - In the first place, I tried to change the hack a bit, so that everyone would have been able to change the language by that menu. But then some users didn't like it - i changed it back and overlooked that part. Soooo, shame on me ;)

bjornstrom 02-22-2004 12:36 PM

Would it be possible to use a URL such as:

http://www.99mac.se/forum/?styleid=1&language=2

(this way I could use the 99mac.se domain for swedish and .com for english)

JoergZ 02-22-2004 01:11 PM

You must use http://www.99mac.se/forum/index.php?...stlanguageid=2

Then the forum will be shown in the language-id 2 for guests.

J?rg


Quote:

Originally Posted by bjornstrom
Would it be possible to use a URL such as:

http://www.99mac.se/forum/?styleid=1&language=2

(this way I could use the 99mac.se domain for swedish and .com for english)


mtha 02-22-2004 06:34 PM

Quote:

Originally Posted by JoergZ
You must use http://www.99mac.se/forum/index.php?...stlanguageid=2

Then the forum will be shown in the language-id 2 for guests.

J?rg

It'd be nice if there's also an option for force some forum/board to display in some language, even for registered users.

Say if you user http://www.mydomain.com/forum/index....X&languageid=X
then, everyone use that link will see the forum (or some board) in that language.

It's helpful when you have a forum with multiple languages boards, one board in English, one board in German, for example. If someone goes to German board, they are force to use German :P (regardless they are guests or members)

JoergZ 02-22-2004 07:09 PM

Well, the laguage-selection for registred users is not touched by my modification, because there you can select your language in the user-settings.

Maybe the language-selection (regardless if logged in or not) will work one day in standard-vB via parameter in the url, then you have a solution for that. :)

mtha 02-27-2004 08:09 PM

Quote:

Originally Posted by JoergZ
Well, the laguage-selection for registred users is not touched by my modification, because there you can select your language in the user-settings.

Maybe the language-selection (regardless if logged in or not) will work one day in standard-vB via parameter in the url, then you have a solution for that. :)

:p I'm playing with the parameters, trying to force languageid to be something different than default one, for registered member, but havent got any success.

Do you have any suggestion?

JoergZ 02-29-2004 06:53 PM

It will not work for registred members, because the parameter is not read out neither by vB nor by my modification.

The only way to manage this for registred members, is to call an own php, where you modify the database-record. A german user requested this, so I made an "quick-and-dirty", not official solution for him. You can find it in the german-vb board.


J?rg

JoergZ 03-09-2004 08:06 PM

I have added a version 3 of my hack. It is based on version 1, but was extended by WildChild and detects the user's browser language automatic, so the user will see the board in his language without selecting it manually.

You find the version 3 in the first post of this thread.

Thanks to WildChild.


Jörg

Lurk 03-27-2004 04:04 AM

Quote:

Originally Posted by JoergZ
I have added a version 3 of my hack. It is based on version 1, but was extended by WildChild and detects the user's browser language automatic, so the user will see the board in his language without selecting it manually.

You find the version 3 in the first post of this thread.

Thanks to WildChild.


J?rg

is there a way to add this thing for registered users?
so there will be fast language selection on the navbar...

JoergZ 03-27-2004 08:15 AM

Yes, I have written a soloution for that, because a german user asked me the same. I will post it this afternoon here.

But can you tell me for what this make sense ? Which user switches the language after he selected it once ?

(I am using it only in my local test-board so I can check the translations without always going the long way via the user-settings).


Jörg

JoergZ 03-27-2004 09:48 AM

O.k., here we go:

To change the language use the following line in the navbar template:

PHP Code:

 <tr><td class="vbmenu_option"><a href="changelanguage.php?$session[sessionurl]languageid=1">Name of language 1</a></td></tr
<
tr><td class="vbmenu_option"><a href="changelanguage.php?$session[sessionurl]languageid=2">Name of language 2</a></td></tr


Add to the phrasegroup Front-End Redirect Messages the following 2 phrases:

Varname: changelanguage
Text: Boardlanguage was changed

Varname: nochangelanguage
Text: Language was not changed


Save the changelanguage.php I have attached in the main board directory (where you have your index.php).

That's all.



Best Regards

J?rg

AZone 04-08-2004 06:25 PM

This is a great hack! Easy and very usefull! Thank you a lot!

ricoche 04-24-2004 02:11 PM

Hello,

Thanks for the hack.

Any idea why I might be getting this error on line 76?

Code:

Parse error: parse error, expecting `']'' in /home/username/public_html/forums/changelanguage.php on line 76
Here is the code from line 75 to line 79. Is there anything missing or incorrect here?

Code:

        if (($check_language == '')  or ($check_language[
        {
                $url = "$vboptions[forumhome].php?$session[sessionurl]";
                eval(print_standard_redirect('nochangelanguage'));
        }

Thanks.

JoergZ 04-24-2004 04:52 PM

Sorry, don't know how this garbage came into the changelanguge.php

I have corrected the attachment.

You can solve the problem like this:

Change this line
PHP Code:

 if (($check_language == '') or ($check_language

to this

PHP Code:

 if ($check_language == ''


J?rg

jluerken 05-06-2004 07:02 PM

Hi Joerg,

many thanks for this Hack.

I installed it and via a condition in the header template only GUESTS have the choice. This is working on all pages at not only on forumhome. Its also working on the vbAdvance Portal page...

See screenshots :D

Bobbo 07-01-2004 12:51 PM

Great hack, thanks for your efforts. I had to do a little monkeying around with it since I am using VBA CMPS and the main index resides outside the forums directory.

However with a few minor modifications and some conditionals it is now working for both registered/logged in users as well as for guests from both the forum home as well as from VBA CMPS home page.

Thanks again.

Merjawy 07-22-2004 12:17 AM

Very nice indeed and pretty much needed for many

thanks,

one question, you have ver. 1, 2 and 3,, which do I need to install? all? :) forgive my asking just confused a little

I do know the logic in doing things ,, but this one did confuse me a bit sorry :)

JoergZ 07-22-2004 07:47 AM

You need only to install one of the versions.


The different is:

Version 1:
You must define a new navbar-menue-item everytime you install a new language and want to make it selectable in the navbar

Version 2:
The installed and selectable languages are detected automatic, no need to add new navbar-item when a new language is installed

Version 3:
One of your languages is the default-language. Every visitor who comes first time to your board will see the board in this default-language. Version 3 detects the language-settings of the users browser and automatic set the vB-language to this language if available. Example: Default is English, you have installed English, German, French, Spanish. A user with French language-setting in browser come first time to your board, he will see it in French. No need for him to select the language of your board manually.

I hope your confusion is gone now :)

Best regards

J?rg

Merjawy 07-22-2004 10:29 PM

Indeed gone now :) thnx a lot mate


All times are GMT. The time now is 02:46 AM.

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.01382 seconds
  • Memory Usage 1,851KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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