Yii::t() trying to translate Yii::powered() not working.

Hi,

I’m translating my application.

I can translate all my string to the correct browser preferredLanguage().

But, (there is allways a but) i can’t translate




Yii::powered();



the YiiBase.php




	/**

	 * Returns a string that can be displayed on your Web page showing Powered-by-Yii information

	 * @return string a string that can be displayed on your Web page showing Powered-by-Yii information

	 */

	public static function powered()

	{

		return Yii::t('yii','Powered by {yii}.', array('{yii}'=>'<a href="http://www.yiiframework.com/" rel="external">Yii Framework</a>'));

	}



i’ve created a yii.php file under messages/languageID/

I’m using yii 1.1.9.r3527

and




Yii::t('yii', Yii::powered());



is not working, any ideias? (i’ve seen a bug in the code.google.com tracker)

(i’m not allowed to post links) :(

and it’s closed (corrected?!) by revision 3392, and for some reason that revision YiiBase.php powered() method is different then the revision i’m using.

any ideas?!

thanks

Check the source of the powered function… It already uses the t() method to get the translation… so why would you again do


Yii::t('yii', Yii::powered());

Why don’t you just add translation for your language for “Powered by {yii}.” string like:


array(

...

'Powered by {yii}.'=>'Some translation {yii}',

...

)

currently i’m at…

since my yiiBase.php powered method() is




        public static function powered()

        {

                return Yii::t('yii','Powered by {yii}.', array('{yii}'=>'<a href="http://www.yiiframework.com/" rel="external">Yii Framework</a>'));

        }



i’ve added to my messages/pt_pt/yii.php




<?php

return array(

'Powered by {yii}.'=>'Desenvolvido com {yii}',

);

?>



my main.php (layout file)




<?php echo Yii::powered(); ?>



shouldn’t this simple echo translate the Powered by string?

what am i doing wrong here? cos it isn’t translating.

Your messages should be not in your site/messages/pt_pt/yii.php, but in "/yii/framework/messages/pt/yii.php" because "yii" is referenced in the core messages, not user messages.

oh…my bad.

but editing the framework will be a pain in the *** if later i want to update…need to take care with those files… but now i know that that is one solutions. thanks for your help!