Yii Framework Forum: Categories In Databases - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Categories In Databases Internalization Rate Topic: -----

#1 User is offline   Franker 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 02-January 13

Posted 25 January 2013 - 09:17 PM

Hey

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 :-(

Thx!
0

#2 User is online   PeRoChAk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 578
  • Joined: 26-November 10
  • Location:Lahore, Pakistan

Posted 25 January 2013 - 10:27 PM

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

languages
id             name
1              ENGLISH
2              URDU


categories_meta
id cat_id lang_id value
1  1       1      Shop
2  1       2      Dukan


Thanks
Cheers
Perochak
Web Design - Logo Design - Application Development

My Blog | Forums Comparison
0

#3 User is offline   Franker 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 02-January 13

Posted 25 January 2013 - 10:36 PM

View PostPeRoChAk, on 25 January 2013 - 10:27 PM, said:

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

languages
id             name
1              ENGLISH
2              URDU


categories_meta
id cat_id lang_id value
1  1       1      Shop
2  1       2      Dukan


Thanks


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?

Thanks!
0

#4 User is offline   mbi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 604
  • Joined: 08-May 09

Posted 26 January 2013 - 05:44 AM

your post sounds like this
http://www.yiiframew...in-just-1-line/
0

#5 User is online   PeRoChAk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 578
  • Joined: 26-November 10
  • Location:Lahore, Pakistan

Posted 26 January 2013 - 05:48 AM

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. en.mysite.com or mysite.com/en

Check some below

http://www.yiiframew...nguage-behavior
http://www.yiiframew...language-picker
http://www.yiiframew...i-multilanguage
http://www.yiiframew...ingual-behavior

thanks
Cheers
Perochak
Web Design - Logo Design - Application Development

My Blog | Forums Comparison
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users