First of all I would like to wish happy new year to everyone here.
Now come to my problem. well i am creating a multilingual platform in yii. I know the Internationalization in yii and i have implemented it also.But now what i am looking for is.A text should be manageable from back end of the platform.
Can anybody give me some good idea to start this work.that how to manage the static words and change language with request.Since I do not want to hardcore any of a code that is why i am looking for any powerful and good approach for this task.
Your advice and ideas are very important for me.!!
You can do this by creating a database table which store information about the text you want to be used for your site.
For example
variables table
id name
1 SiteName
2 Contact
Language Table
id name
1 English
Variable_Language
variable_id Language_id Translation
1 1 SiteName
2 1 Contact us
To use this concept, you need to have three tables as I have said
Variables // Will contain the variables that you want to translate
Languages // Language that you want to use for the application
Translation // Translation of variable to specific language
How it will be used?
First of All when a user first time enters the site, default language will be used.
If user wants to change the language, then this language will be used as default for the content and you can set this language using config of Yii application.