Yii Framework Forum: I18N - Yii Framework Forum

Jump to content

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

I18N Rate Topic: -----

#1 User is offline   kitty10 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 139
  • Joined: 13-April 10

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?
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 30 April 2010 - 05:50 AM

Everything is described in fine detail here:
http://www.yiiframew...ide/topics.i18n
0

#3 User is offline   kitty10 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 139
  • Joined: 13-April 10

Posted 30 April 2010 - 06:04 AM

View PostMike, on 30 April 2010 - 05:50 AM, said:

Everything is described in fine detail here:
http://www.yiiframew...ide/topics.i18n


Yes i have just read this page....
My question was directed to someone who had just done this work as to facilitate the work telling me how can...
0

#4 User is offline   zitter 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 140
  • Joined: 14-July 09

Posted 30 April 2010 - 06:38 AM

Using Yii::t() function you can do that.
0

#5 User is offline   kitty10 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 139
  • Joined: 13-April 10

Posted 30 April 2010 - 07:43 AM

View Postzitter, on 30 April 2010 - 06:38 AM, said:

Using Yii::t() function you can do that.

Yes i have read of this function Yii::t()...but where I put???
In the main???In the controller???
0

#6 User is offline   zitter 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 140
  • Joined: 14-July 09

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.
0

#7 User is offline   kitty10 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 139
  • Joined: 13-April 10

Posted 30 April 2010 - 08:41 AM

View Postzitter, 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?
0

#8 User is offline   Onman 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 175
  • Joined: 26-December 09
  • Location:The Netherlands

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

0

#9 User is offline   kitty10 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 139
  • Joined: 13-April 10

Posted 01 May 2010 - 03:43 AM

View PostOnman, 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:
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???
0

#10 User is offline   Onman 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 175
  • Joined: 26-December 09
  • Location:The Netherlands

Posted 01 May 2010 - 04:48 AM

Please read this manual:
http://www.yiiframew...ide/topics.i18n
(look for the header 'Message Translation')
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