Skip to content

Commit

Permalink
Fix i18n source message create translation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodeholic committed Oct 26, 2017
1 parent 4653a71 commit a65e775
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
10 changes: 2 additions & 8 deletions controllers/I18nController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function actionCreate()
if ($model->load(Yii::$app->request->post(), null) && $model->save()) {
return $this->redirect(['index']);
}
return $this->render('update', [
return $this->render('create', [
'model' => $model,
'locales' => $locales
]);
Expand All @@ -92,17 +92,11 @@ public function actionUpdate($id)
if ($model->load(Yii::$app->request->post(), null) && $model->save()) {
return $this->redirect(['index']);
}
$categories = ArrayHelper::map(
I18nSourceMessage::find()->select('category')->distinct()->all(),
'category',
'category'
);
$locales = LocaleHelper::getAvailableLocales();

return $this->render('update', [
'model' => $model,
'locales' => $locales,
'categories' => $categories
'locales' => $locales
]);
}

Expand Down
3 changes: 1 addition & 2 deletions views/i18n/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

<?php echo $this->render('_form', [
'model' => $model,
'locales' => $locales,
'categories' => $categories
'locales' => $locales
]) ?>

</div>
4 changes: 1 addition & 3 deletions views/i18n/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/* @var $this yii\web\View */
/* @var $model centigen\i18ncontent\models\I18nSourceMessage */
/* @var $locales array */
/* @var $categories array */

$this->title = Yii::t('i18ncontent', 'Update {modelClass}: ', [
'modelClass' => 'I18n message',
Expand All @@ -20,8 +19,7 @@

<?php echo $this->render('_form', [
'model' => $model,
'locales' => $locales,
'categories' => $categories
'locales' => $locales
]) ?>

</div>

0 comments on commit a65e775

Please sign in to comment.