Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

One Forum, two languages at the same time

Quote Reply
One Forum, two languages at the same time
Hello World,

I have searched the forum for info on this, but couldn't find any...

What I would like to be able to do is have my forum in French and English at the same time. I would use two main categories for both languages. That way the English Forums are in the English category and the French Forums would be in the French category. That much is easy to do...

Now the real bonus would be to also have two languages.txt so that both English and French can view the forum buttons in either of the two languages.

I would ask my visitors what language they wish to have all the forum buttons in and that could even be kept with the user info so that they only have to choose once when they first sign up.

Has anyone done this before?
I think it shouldn't be complicated, may bee a global could do the trick. I cold also add a column in the user info table, and then of course I would translate into French myself.

For European Forums, this would be a great value added to the GT Forum!
Quote Reply
Re: [nt6] One Forum, two languages at the same time In reply to
What you want is already implemented in the form of template sets.

You basically have to have two template sets, one in english and one in french. This also means that you have to files language.txt in the appropriate template directories.

Users can select a default template set (i.e. a default language). See also the comments in the "user_profile_display.html" template.

One of the template sets is the default one. It is used when the user has no prefence. You can use the other template set by simply doing gforum.cgi?t=other_template_set.

And what is even nicer is that you don't even have to have all the templates in the alternative template directory, you just need language.txt, and a file called .tplinfo (not the dot) that controls the inheritance (you can also find this file e.g. in the default_top directory).

Tell us if you succeed!

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] One Forum, two languages at the same time In reply to
Thank you.
I will start cracking now!
Quote Reply
Re: [yogi] One Forum, two languages at the same time In reply to
Yogi,

it was easy to do. Thanks.

The only bug I have is that the globals I created do not work with the language that is not selected as default.

Do you know what I need to do for the template set to return the global values when this template set is not the default for the forum?

Thank you for your time.
Quote Reply
Re: [nt6] One Forum, two languages at the same time In reply to
If I understand you correctly:

I would think that the globals should also be inherited (as defined in .tplinfo), but I might be mistaken.

You could of course always copy the globals to the altenative template directory.

But I don't know for sure.

Ivan
-----
Iyengar Yoga Resources / GT Plugins