Yii Framework Forum: I18N Bug - Yii Framework Forum

Jump to content

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

I18N Bug Rate Topic: -----

#1 User is offline   Babas007 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 03-January 13

Posted 18 January 2013 - 10:18 AM

Hi,

I want to use i18n in my web application, and it doesn't work as it should (I guess), here is the code i'm using:
Yii::t('types', 'FUN')


And the result is that it displays 'FUN' instead of 'cool'. I tried to debug, and it look for this file:
C:\ProgramData\wamp\www\CoolApp\protected\messages\fr\zii.php


Why zii.php??? I correctly indicated 'types' right?
0

#2 User is offline   Aneesh Asokan 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 240
  • Joined: 26-September 12

Posted 18 January 2013 - 11:01 PM

View PostBabas007, on 18 January 2013 - 10:18 AM, said:

Hi,

I want to use i18n in my web application, and it doesn't work as it should (I guess), here is the code i'm using:
Yii::t('types', 'FUN')


And the result is that it displays 'FUN' instead of 'cool'. I tried to debug, and it look for this file:
C:\ProgramData\wamp\www\CoolApp\protected\messages\fr\zii.php


Why zii.php??? I correctly indicated 'types' right?


you can change the file(protected\messages\fr\zii.php) name zii to types (protected\messages\fr\types.php

Check these links:
1. http://www.yiiframew.../en/topics.i18n
2. http://learnyii.blog...nalization.html
Thanks
Aneesh.
0

#3 User is offline   Babas007 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 03-January 13

Posted 21 January 2013 - 09:22 AM

The problem is I don't have any ziiphp file, I have a types.php and for some reasons it does not work. Did I miss something?
0

#4 User is offline   mirunho 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 170
  • Joined: 19-December 12
  • Location:Gdansk, Poland

Posted 21 January 2013 - 09:58 AM

zii.php is framework file, its seems like it didnt load a fr lang at start, do you have any lang picker ?
0

#5 User is offline   Babas007 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 03-January 13

Posted 24 January 2013 - 01:58 AM

no, but i think it did load the language at start 'messages\fr\zii.php'. I configured for fr
0

#6 User is offline   mirunho 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 170
  • Joined: 19-December 12
  • Location:Gdansk, Poland

Posted 24 January 2013 - 02:33 AM

How did you set your CApplication::sourceLanguage and CApplication::language ?
0

#7 User is offline   Babas007 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 03-January 13

Posted 27 January 2013 - 05:35 AM

View Postmirunho, on 24 January 2013 - 02:33 AM, said:

How did you set your CApplication::sourceLanguage and CApplication::language ?


Like this, in the main config file php:
return array(
    ...
    'sourceLanguage' => 'fr',
    'language' => 'fr'
);

0

#8 User is offline   mirunho 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 170
  • Joined: 19-December 12
  • Location:Gdansk, Poland

Posted 28 January 2013 - 02:25 AM

View PostBabas007, on 27 January 2013 - 05:35 AM, said:

Like this, in the main config file php:
return array(
    ...
    'sourceLanguage' => 'fr',
    'language' => 'fr'
);




So there is nothing to translate.
"For a Yii application, we differentiate its target language from source language. The target language is the language (locale) of the users that the application is targeted at, while the source language refers to the language (locale) that the application source files are written in. Internationalization occurs only when the two languages are different."

please read http://www.yiiframew.../en/topics.i18n
0

#9 User is offline   Babas007 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 03-January 13

Posted 29 January 2013 - 02:22 PM

View Postmirunho, on 28 January 2013 - 02:25 AM, said:

So there is nothing to translate.
"For a Yii application, we differentiate its target language from source language. The target language is the language (locale) of the users that the application is targeted at, while the source language refers to the language (locale) that the application source files are written in. Internationalization occurs only when the two languages are different."

please read http://www.yiiframew.../en/topics.i18n


Thanks a lot, it worked, I changed sourceLanguage to 'en'
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