1

Topic: Making punBB multilang

Hi,

I've a need for a web site I make for a projet. The site is organisezd as to enable multiple languages. There's a default language (french, the base lang of the project), but the user can select translated pages, its choice being saved by a cookie.
The only part I can't make rely to this scheme is the forums (punBB of course), because the forum is in a fixed default language, or a visitor has to be logged to set the language according to its profile.
I think the lack is to enable the default language by a variable (that could be assigned in template like pun_setlang($lang);

Is this feature planned, or at least, do you think this could be an interesting feature ? I can try to hack the code and propose a patch, but I'm not a good php programmer, so maybe someone else (from the punbb dev team) could do that ?

Bye
Richard

Re: Making punBB multilang

how would it know what language to use if the visitor is not a user?

3

Re: Making punBB multilang

Connorhd wrote:

how would it know what language to use if the visitor is not a user?

I assume that if the guest is surfing the Klingon language section of the site and has accessed the forum from that section he wants PunBB to realise that fact. That would mean selecting the language pack according to a site wide language variable rather than user preference. I don't know how to do it but I would think somebody does. Maybe a cookie could be set according to which section of the site the user is coming from.

Re: Making punBB multilang

well if the rest of the site detects the language then surely you just add that to punbbs language chosing bit?

5

Re: Making punBB multilang

HTTP includes an Accept-Language: header for things like this.

6

Re: Making punBB multilang

In fact, for now you have in order of priority:
-  the user's profile language
- the default forum language

It will be:
-  the user's profile language
- the default forum language
- the global site language

graue, hmm, I don't know this http header tag.
But the trick is to make punbb display localized pages, does it detect this ?

Re: Making punBB multilang

Should be a rather simple hack to include/functions.php. You'd need to edit check_cookie() to deal with logged in users and set_default_user() for anonymous users.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

8

Re: Making punBB multilang

Thanks for reply Rickard

I'll try to make the  hack.
Do you want me to send a patch for an eventual apply in the future ?