Yii Framework Forum: Yii:t() and choice format - Yii Framework Forum

Jump to content

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

Yii:t() and choice format Rate Topic: -----

#1 User is offline   dotangelo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 06-April 10

Posted 17 April 2010 - 09:52 AM

Hi,
I'm using Yii's function t() in order to translate some message.
My code looks like this:
<?php echo Yii::t('shop', '1#one book|n>1#many books', $count); ?>


The error I get here is:
Fatal error: Cannot unset string offsets in C:\www\framework\YiiBase.php on line 484


When I change "$count" to "5", error changes to:
strtr() [<a href='function.strtr'>function.strtr</a>]: The second argument is not an array


Am I missing something ?
"Because some things, just need to be improved."
0

#2 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 17 April 2010 - 09:58 AM

the third parameter should be an array.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#3 User is offline   dotangelo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 06-April 10

Posted 17 April 2010 - 11:54 AM

Damn, it worked. Thank you.
"Because some things, just need to be improved."
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