From 38061247d6a03fc40b7ca510df8150dfcca4ffe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Moln=C3=A1r?= Date: Sat, 29 Apr 2017 18:12:31 +0200 Subject: [PATCH] Add usage hint for the search empty command --- controllers/actions/TranslateAction.php | 1 + views/language/translate.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/controllers/actions/TranslateAction.php b/controllers/actions/TranslateAction.php index 5eb063c..d22dd4b 100644 --- a/controllers/actions/TranslateAction.php +++ b/controllers/actions/TranslateAction.php @@ -41,6 +41,7 @@ public function run() return $this->controller->render('translate', [ 'dataProvider' => $dataProvider, 'searchModel' => $searchModel, + 'searchEmptyCommand' => $this->controller->module->searchEmptyCommand, 'language_id' => Yii::$app->request->get('language_id', ''), ]); } diff --git a/views/language/translate.php b/views/language/translate.php index 477d4e2..fa32a7b 100644 --- a/views/language/translate.php +++ b/views/language/translate.php @@ -16,6 +16,7 @@ /* @var $language_id string */ /* @var $dataProvider yii\data\ActiveDataProvider */ /* @var $searchModel lajax\translatemanager\models\searches\LanguageSourceSearch */ +/* @var $searchEmptyCommand string */ $this->title = Yii::t('language', 'Translation into {language_id}', ['language_id' => $language_id]); $this->params['breadcrumbs'][] = ['label' => Yii::t('language', 'Languages'), 'url' => ['list']]; @@ -59,7 +60,11 @@ [ 'format' => 'raw', 'attribute' => 'translation', - 'filterInputOptions' => ['class' => 'form-control', 'id' => 'translation'], + 'filterInputOptions' => [ + 'class' => 'form-control', + 'id' => 'translation', + 'placeholder' => $searchEmptyCommand ? Yii::t('language', 'Enter "{command}" to search for empty translations.', ['command' => $searchEmptyCommand]) : '', + ], 'label' => Yii::t('language', 'Translation'), 'content' => function ($data) { return Html::textarea('LanguageTranslate[' . $data->id . ']', $data->translation, ['class' => 'form-control translation', 'data-id' => $data->id, 'tabindex' => $data->id]);