Posts Tagged with yii translation

Displaying 1-3 of 3 results.
Resolved: Yii translation not working
posted by admin on April 12, 2016
My Yii app translation code is stop working

<?php echo Yii::t('t', 'Added'); ?>


My Messages folder and file:

- messages
- ru
- t.php
Read more
Wiki: Yii 1.1 Add Yii Translation to website, multilanguage functionalitywiki
posted by admin on March 5, 2016
1. Step
Create Messages Folder in directory protected

2. Step
Create your multilanguage translation folder in directory Messages, for example hy, ru etc.

3. Step
Create files translation.php in your translation folders, which you created hy, ru

4. Step
Edit your translation.php files, and open massive like

<?php
/* ру */
return array(
'Username'=>'Имя пользователя',
'Admin'=>'Админ'
)


5. Step
Call translation function on your project

Yii::t('translation', 'Username')//translation - translation.php, 'Username' - the word, which you want to translate


* You can have many translation to same word

You can create for example app.php on your translation folders 'hy', 'ru' etc., and you can call same word by another translation.

6. Step
You can Create files app.php in your translation folders, which you created hy, ru

7. Step
Edit your app.php files, and open massive like

<?php
/* ру */
return array(
'Username'=>'Логин',
'Admin'=>'Администратор'
)


8. Step
Call translation function on your project by different translation

Yii::t('translation', 'Username')//translation - translation.php, 'Username' - the word, which you want to translate

or

Yii::t('app', 'Username')//app - app.php, 'Username' - the word, which you want to translate
Read more
Resolved: Yii 1.1 How to change home name breadcrumbs to another or multilanguage
posted by admin on March 5, 2016
In main layout i have this code

<?php if(isset($this->breadcrumbs)):?>
<?php $this->widget('zii.widgets.CBreadcrumbs', array(
'links'=>$this->breadcrumbs,
)); ?><!-- breadcrumbs -->
<?php endif ?>


I want to change the word Home and include multilanguage outputRead more