1 (edited by BlindMan 2006-05-26 12:16)

Topic: Multilang forum and categories.

Hi,

I plan to develop an internationalization mod for PunBB.
I already did a dirty hack for phpBB for one of my boards, but I'd like to make something cleaner for punbb.

One of the functions of the mod would be to get forums, descriptions and categories in the user's language.

So I add 2 tables, one for the alternate forum languages, and another one for the description.
In each table, I put an ID in each table (as primary key), the original categorie and forum ID, the translation and the language.

But I'm very noob at using complex queries.

I think it will be possible to get the alternative language using the original (big) query, but all my tries failled.
I could make simpler queries, but I think that the number of queries would not be acceptable.

The original query in index.php:

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

Do you think this is a good approach? Would there be a simpler system to do this cleanly?
How would you do this?

I used the $lang[] system for my phpBB hack, but this is dirty ... even if it is the simplest way to do it.

Thanks.

Re: Multilang forum and categories.

Nobody's interested by a multi-lang mod? sad

3

Re: Multilang forum and categories.

Would it not be rather confusing if the category descriptions and forum descriptions are in the users langauge and then the posts themselves are in a different language. People will reasonably assume that if a forum description is in say French then the whole forum including the posts will also be French.

Re: Multilang forum and categories.

Hi Paul, and thanks for your answer.

As I told before, it would be a part of an internationalization mod. It's only one of the functions.
I already did other parts:
- Automatic language detection for guests
- Storing user's language, and adding a tag with the used language before the topic title
- In the topics, a link proposing a babelfish traduction from the original language to your's
- The ability to filter only one language in the topic lists.

The goal is to reduce the language barrier... I think it's a better approach than creating one section for each supported language.
It may be interesting for the board's which have a massively multilang vocation (support forums?)

Re: Multilang forum and categories.

Ok, I used the lang file's array system instead of the DB.

The translation replaces the original title, if availlable.

Thanks for your help.

6

Re: Multilang forum and categories.

is your mod public?  :-)
I woukd be interested about your progress smile

7 (edited by BlindMan 2006-06-19 08:40)

Re: Multilang forum and categories.

Actually it's not clean enough to be distributed.

If you're interested, I'll package it, and you'll be able to see if you like it or not... but before this, I will have to finish some little things on it wink

ps: I didn't work much on it since nobody seemed to be interested.

Re: Multilang forum and categories.

i have an idea how to make its easy to implemet. i have also that same problem. i want to create a big site about linux, so it will include forums. so....
www.forum.pl.e-linux.info
www.forum.en.e-linux.info
www.forum.de.e-linux.info
at start i want to create these 3 forums. so, its no problem, but what if somebody wants to post on de and en? (know 2 languages?) creating user account on each one is not too good idea... so........

lets do it that way: in admin we creating categories. so let the category give subcategory. now:
category: polish
subcategory: distros
subcategory: mirrors
subcategory: linux as server
subcategory: linux as personal computer
etc.

that same for other languages. so, and when user visit the page forum automatically detects its language (or get it from profile settings) and switch to right category, but also user will be able to look to other languages.
how to make it better? lets copy punbb to 3 different directories. in config.php should be option
define("RESTRICT_TO_ONLY_ONE_CATEGORY", category_id);
and this restriction shows only one category, and also in search field will be only one category.
one database, multilanguage forum.

so... did you get the idea? understand me?