Page 1 of 1
I18N
#1
Posted 30 April 2010 - 04:47 AM
How do I insert the Internationalization(I18N)in my web application?
It 's a complicated thing, or you can do in a short time?
I want translate the messages in English .. is that possible?
It 's a complicated thing, or you can do in a short time?
I want translate the messages in English .. is that possible?
#3
Posted 30 April 2010 - 06:04 AM
#6
Posted 30 April 2010 - 08:04 AM
You can put everywhere: in a model, or in a controller, but generally you can find them in the views.
#7
Posted 30 April 2010 - 08:41 AM
zitter, on 30 April 2010 - 08:04 AM, said:
You can put everywhere: in a model, or in a controller, but generally you can find them in the views.
Ah ok,now i try to put this function in the view of one of my model and i look what's happens
But putting this feature only get the internalization??
But how do I tell him I want the English translation?
Pass the argument in the function?
#8
Posted 30 April 2010 - 05:51 PM
in you application configuration you can set these 2 attributes:
1. language: the language you want to use for this user. So to use the english translation you set this to 'en_us' (for USA english) or 'en_en' (for British english).
2. sourceLanguage: the language you have used when developing your web-application, e.g. 'it_it' for italian.
Anywhere in your application (view or source code) where you want to use a string which needs to be translated you use:
Some examples:
1. language: the language you want to use for this user. So to use the english translation you set this to 'en_us' (for USA english) or 'en_en' (for British english).
2. sourceLanguage: the language you have used when developing your web-application, e.g. 'it_it' for italian.
Anywhere in your application (view or source code) where you want to use a string which needs to be translated you use:
Yii::t('yii','Buon giorno')Some examples:
$messageString=Yii::t('yii','Bellisimo');
<ul>
<li>1. <?php echo Yii::t('yii','Uno'); ?> </li>
<li>2. <?php echo Yii::t('yii','Dos'); ?> </li>
<li>3. <?php echo Yii::t('yii','Tres'); ?> </li>
</ul>
#9
Posted 01 May 2010 - 03:43 AM
Onman, on 30 April 2010 - 05:51 PM, said:
in you application configuration you can set these 2 attributes:
1. language: the language you want to use for this user. So to use the english translation you set this to 'en_us' (for USA english) or 'en_en' (for British english).
2. sourceLanguage: the language you have used when developing your web-application, e.g. 'it_it' for italian.
Anywhere in your application (view or source code) where you want to use a string which needs to be translated you use:
Some examples:
1. language: the language you want to use for this user. So to use the english translation you set this to 'en_us' (for USA english) or 'en_en' (for British english).
2. sourceLanguage: the language you have used when developing your web-application, e.g. 'it_it' for italian.
Anywhere in your application (view or source code) where you want to use a string which needs to be translated you use:
Yii::t('yii','Buon giorno')Some examples:
$messageString=Yii::t('yii','Bellisimo');
<ul>
<li>1. <?php echo Yii::t('yii','Uno'); ?> </li>
<li>2. <?php echo Yii::t('yii','Dos'); ?> </li>
<li>3. <?php echo Yii::t('yii','Tres'); ?> </li>
</ul>
Ok but i don't understand..if i have a button to translate or other?
I put this but how can translate???
#10
Posted 01 May 2010 - 04:48 AM
Please read this manual:
http://www.yiiframew...ide/topics.i18n
(look for the header 'Message Translation')
http://www.yiiframew...ide/topics.i18n
(look for the header 'Message Translation')
Share this topic:
Page 1 of 1

Help














