Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3806124

Browse files
committed
Add usage hint for the search empty command
1 parent 322267f commit 3806124

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

controllers/actions/TranslateAction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function run()
4141
return $this->controller->render('translate', [
4242
'dataProvider' => $dataProvider,
4343
'searchModel' => $searchModel,
44+
'searchEmptyCommand' => $this->controller->module->searchEmptyCommand,
4445
'language_id' => Yii::$app->request->get('language_id', ''),
4546
]);
4647
}

views/language/translate.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/* @var $language_id string */
1717
/* @var $dataProvider yii\data\ActiveDataProvider */
1818
/* @var $searchModel lajax\translatemanager\models\searches\LanguageSourceSearch */
19+
/* @var $searchEmptyCommand string */
1920

2021
$this->title = Yii::t('language', 'Translation into {language_id}', ['language_id' => $language_id]);
2122
$this->params['breadcrumbs'][] = ['label' => Yii::t('language', 'Languages'), 'url' => ['list']];
@@ -59,7 +60,11 @@
5960
[
6061
'format' => 'raw',
6162
'attribute' => 'translation',
62-
'filterInputOptions' => ['class' => 'form-control', 'id' => 'translation'],
63+
'filterInputOptions' => [
64+
'class' => 'form-control',
65+
'id' => 'translation',
66+
'placeholder' => $searchEmptyCommand ? Yii::t('language', 'Enter "{command}" to search for empty translations.', ['command' => $searchEmptyCommand]) : '',
67+
],
6368
'label' => Yii::t('language', 'Translation'),
6469
'content' => function ($data) {
6570
return Html::textarea('LanguageTranslate[' . $data->id . ']', $data->translation, ['class' => 'form-control translation', 'data-id' => $data->id, 'tabindex' => $data->id]);

0 commit comments

Comments
 (0)