Categories In Databases

(Frank Gutknecht) #1


I have some categories in my Database.

For Example some Countries.

ID 1 NAME England

ID 2 NAME France

ID 3 NAME Spain

If I want to translate these categories into other languages, is it useful to save the categories in english (My sourceLanguage) like in my example or is it better to save just keys for the names?

Are there any good tutorials about internalization? I’ve read “Agile Web Application Development” and the “YII Cookbook” but the explanations are sparse :frowning:


(Amjad Mghl) #2

It is not a good idea.

Instead of doing so, you need to translate them and save in database.

There should be something like as


id             name

1              ENGLISH

2              URDU


id cat_id lang_id value

1  1       1      Shop

2  1       2      Dukan


(Frank Gutknecht) #3

Ok, thanks… do you know some good tutorials for internalization?

How can I set flags on the site and change the language?

How can I recognize from which countries the users come?

Should I save the language in the Session (cookie) of the user?


(mbi) #4

your post sounds like this

(Amjad Mghl) #5

1 - Set a Default Language in config.php

2 - Use Portlet/widget to allow user to select language he wants

3 - Yes, it is important. If you do not want then have sub domains or sub dirs i.e. or

Check some below