How to use findLocalizedFile on images with links?

Hello,

can anyone explain me the use of Yii::app()->findLocalizedFile ?

I tried the following:


<?php $button = CHtml::image(Yii::app()->findLocalizedFile('/site/images/button.png','en','de_de'), 'Register', array('id' => 'Button'));


echo CHtml::link($button, array('/controller/action')); ?>  

And just this:


Yii::app()->findLocalizedFile('/site/images/button.png','en','de_de');

And:


<?php $button = Yii::app()->findLocalizedFile(CHtml::image('/site/images/button.png'), 'Register', array('id' => 'Button'),'en','de_de');


echo CHtml::link($button, array('/controller/action')); ?>  

My button.png image is in its folder images, and images/de_de/button.png, but it shows only the image from image/button.png

I’m using the LangUrlManager Extension to switch languages.

Regards,

QueryTom

I also ran into this problem. I didn’t have much time so this is what I did to get the localized image.




$localizedImage=Yii::app()->findLocalizedFile(Yii::app()->basePath.'/../images/image.jpg', 'en');


$localizedImage=str_replace(Yii::app()->basePath.'/..', Yii::app()->baseUrl, $localizedImage);


echo CHtml::image($localizedImage, 'Alt for the image.');