miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
How To miniBB Support Forums / How To /   

How to set up switch language link?

Author ZAP
#1 | Posted: 19 Oct 2004 20:04 
Hello -

So far I'm really appreciating miniBB. I've already spent too many hours of my life cutting out the bloat from other forum apps and tracking down code snippets to hack. miniBB seems to be just what I needed - less is more.

I am creating a new website that is in both English and Spanish. On all my non-forum pages I have simple links ("Switch to English" or "Cambiar al Español") that make it easy for users to see the content in their language (no matter how they arrived). I want to do the same thing in my miniBB forums.

I have installed the Spanish language pack and can switch languages using the standard (2-step) process, but I want to do it in one simple click. Can I just add a query string to a link that switches to the other language (I always know that if I'm viewing English I want to switch to Spanish, and vice-versa)?

I will also be making some other mods to include headers/footers/email templates specific to each language, so if you're interested in that code I'll share it when I finish.

THANKS in advance for your reply.

Author Team
#2 | Posted: 20 Oct 2004 10:31 
Set direct link like:


where "eng" is actually 3-letters code of you language pack.

By the way, in miniBB2 this feature will be for registered users only... they should to define their language in the profile.

Author ZAP
#3 | Posted: 20 Oct 2004 18:39 

Author ZAP
#4 | Posted: 21 Oct 2004 21:19 
By the way, in miniBB2 this feature will be for registered users only... they should to define their language in the profile.

You know, I would reconsider that if I were you...

My situation may be somewhat unique, but for me that would be a major drawback. I have set up several bilingual forums over the last few years (only this most recent one with miniBB, however). Usually I want to integrate these forums into a larger bilingual website (the forums are not the whole site, and I don't want them to be different from the rest). So usually I tweak the forum code to set the language depending upon a hard-coded link rather than a user cookie and have essentially two interfaces (views) of the same forum data (English and Spanish).

I can forward people with user language cookies to the appropriate link (in fact, I usually do that anyway in the rest of the website). But I don't want people who are viewing the Spanish site to suddenly have to switch from English forums because it looks clumsy and not properly integrated. The way miniBB is now, I can tweak the code to have essentially two index.php files using two separate languages and switch among them well using the query string and the other language's page name (so switching languages takes you to the same post, not just the main page).

I know that miniBB is purposefully anti-bloat, but I would give people the option of using user cookies only to set language or including it as a regular query string variable. This last option would mean that people like me wouldn't even need to tweak the code to make it work (which would be ideal). I don't know how many people out there have similar needs, but I think there are more of us than just me.

And if you want to add bloat in order to please us also, add optional fields in the database for alternate language forum titles and descriptions (hee hee hee)...

Author Team
#5 | Posted: 22 Oct 2004 10:32 
Doing this feature for registered users only, we just want to give another one advantage to them. Actually, the situation you have is rather rare than usual, maybe for 10% of miniBB users. Thus, keeping cookie is not ideal solution. When cookie will expire, users must change their language again anyway. But there is another solution, and it is closed to your needs. Before release, we will think how to make it done... The solution is that you set some variable in URL request (for example, $mbblang), and looking for it, script will either TAKE it as default language def, or use another from profile, if user is registered and logged. This time, we will set only session-cookie, which will expire after user closed browser. How do you look at that?..

Author ZAP
#6 | Posted: 1 Nov 2004 20:42 
Hmm... That could work. Any way to pass the language via a URL query should be fine, really.

My concerns are basically two things: Non-registered users who are viewing the Spanish version of the site should not suddenly be cast into English forums (this is confusing and looks unprofessional), and search engine results should link directly to the forum pages in any language (and the page title will help people make their choice).

It's not all that difficult to hack the existing miniBB code to make this work, so as long as it's not much more difficult in the new version I think it could remain an optional hack for those of us with non-standard needs.

Author Claude
#7 | Posted: 10 Dec 2004 17:09 
Has there been any progress in this area? I want to use miniBB for a french and english site and I prefer not to force users to register to select a language. I just installed 2.0 and the query string


does not work. Do I have to use 1.7 ?

Author Team
#8 | Posted: 10 Dec 2004 17:27 
You need to use ....index.php?setlang=eng with miniBB 2.0. User which are logged in, choose their language in profile. So, this is only for anonymous users.

Author Claude
#9 | Posted: 10 Dec 2004 20:12 
Thank you for your fast reply.

How To miniBB Support Forums / How To / How to set up switch language link? Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB