yiisoft/yii2 — pull request #2822 by lucianobaraglia (2014-03-20 03:43:52+00:00)
Title: Proposal: GII generate strings for I18N

See https://github.com/yiisoft/yii2/issues/1108

This is a proposal and only for CRUD.
Once defined and accepted other generators could do it the same way.

Usage:

```php
//
// $generator->translatable = true;
//

echo $generator->generateString('Create');
// echoes Yii::('app', 'Create')

echo $generator->generateString('Create {modelClass}', ['modelClass' => 'Country']);
// echoes Yii::('app', 'Create {modelClass}', ['modelClass' => 'Country'])

//
// $generator->translatable = false;
//

echo $generator->generateString('Create');
// echoes 'Create'

echo $generator->generateString('Create {modelClass}', ['modelClass' => 'Country']);
// echoes 'Create Country'

```