views:

44

answers:

2

Let say i have a basic tagging system (for a craiglists "clone") such as:

Tag (id, tagname) ad(id, title, body) adTag(tag_id, article_id)

This will fit for a non-localized website but what will be the correct aproach for a website that is used by people speaking diferent languages?

Users probably will post ads in diferent languages in one same local area, so, maybe i should make some kind of synonym system that considers "job" and "trabajo" the same tag? But, what about users that only want to see ads in one language?

A: 

Catering for tags for all the different languages is probably just going to be trouble. Going with the idea where you treat all variations of a tag as one single type will probably simplify a lot of the issues (so you don't need to keep track of language-tag mappings on the fly, just do the conversion once and be done with it). If the user needs to search by language later on, then just stick a meta-tag for that particular language on when you save the post.

Of course, that leaves the question of what happens when a user uses tags from multiple languages... but I suppose you can always enforce one single language or something.

futureelite7
A: 

I can think of two possible solutions:

  1. Add language field: Tag (id, tagname, lang) where you can specify the language for the tag

  2. Change Tag to Tag(id) and use separate table for tag translations tagTranslations(tag_id, lang, tagname)

Note: But I think this is only needed, if your articles have multiple translations.

Mihail Dimitrov