Tagging content system - with i18n

The idea is to have a tag system between users and content (images, videos, messages) A ​​kind of tagging system here on SO with questions.

I like the achievement system on SO, which means that after a certain amount of points the user can start creating their own tags. Same idea for my system

My current table design looks like

Tag UserTag User --- ------- ---- tag_id user_id user_id tag_name tag_id username usage_count .... 

This brings me to this point.

Q How can you have a tag system for content in different languages.

  • At the same time, you can search for the same content with tags in different languages.
  • Autocomplete with different languages ​​for the same tag

When I use autocomplete, I look for tag names, such as characters that the user enters.

eg. I have a tag called "night club" in English

while in French, if they noted that the translation would be "discothèque"


Or is there no way to do this, and just let people tag in different languages.

+4
source share
2 answers

Yes, you can. But keep in mind that some words in one language may have multiple translations in others.

You can have a languages table, a tags table with only tag_id and a table with many tables with language_id , tag_id , tag_name .

As I said earlier, you may run into problems when people want to make refinements that their own language allows, but other languages ​​cannot. To stay on the French example, talking about bread, you can have the tags “baguette”, “flûte”, “recuit”, “demi-recuit”, etc., whereas in English there will simply be a tag “bread”. The display between tags in this case is much more complicated. but that the general problem of translation is not only in programming.


Regarding your comment: the trade-off should be to add a tag_related_to_tag table that allows you to create links between tags. Users can specify which tag is associated with another in another language. This will provide maximum flexibility with minimal complexity, but it will require some administration (otherwise you may have evil users who make very unexpected relationships between tags, violating the usefulness of the system).

This is what I was actually going to implement for a website that has a very narrow field (stoic philosophy) and target audience. If the field is too wide, it can be very inefficient.

+2
source

Interest Ask! Just some thoughts (not intended for a complete solution, it is rather a set of questions):

The direct approach has an internal tag identifier, and for each language a localized name.

If a localized name has not yet been created, you may need to return to the tag name in the "main" language - usually in English or in the language in which the tag was created.

The translation must be done by the user. ho knows both languages, automatic translations are inaccurate. So the user is probably right (associated with the rewards?) To rename the tags.

Are all languages ​​the same or are tags created only in the "main language" that is understood by most users, and translations are added separately? (The latter looks less fair, but may make things easier)

You need the ability to combine tags - for example. when users set up a “disco” and a “night club” on their own.

Can I only see tags that are available in my language, or can I see tags that are available in other languages ​​that don’t have translations in my language? Can I search tags in other languages?

Is the tag name included in the query string? Will my German link work when I send it to a friend in the USA?

How to resolve disputes regarding tag value? Example. The closest German translation is "Nachtclub" for a nightclub and "Diskothek" for a "disco". But in German, "Nachtclub" is very different from "Diskothek" (although there is some overlap).

+1
source

All Articles