Skip to content

Commit

Permalink
Dev: moved translation from layout_error to frontend helper
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jan 30, 2017
1 parent 535da3e commit de9b84c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions application/helpers/frontend_helper.php
Expand Up @@ -1745,11 +1745,11 @@ function breakOutAndCrash($sTemplateViewPath, $totalquestions, $iTotalGroupsWith
$sMessage = '';

if ($totalquestions == 0){
$aError['message'] = "There are no questions in this survey.";
$aError['message'] = gT("There are no questions in this survey.");
}

if ($iTotalGroupsWithoutQuestions > 0){
$aError['message'] = "There are empty question groups in this survey - please create at least one question within a question group.";
$aError['message'] = gT("There are empty question groups in this survey - please create at least one question within a question group.");
}

renderError($sTitle, $sMessage, $thissurvey, $sTemplateViewPath);
Expand All @@ -1765,10 +1765,11 @@ function renderError($sTitle, $sMessage, $thissurvey, $sTemplateViewPath )
Yii::app()->twigRenderer->setForcedPath($sTemplateViewPath);

$aError = array();
$aError['title'] = $sTitle;
$aError['message'] = $sMessage;

$aError['title'] = $sTitle;
$aError['message'] = $sMessage;
$thissurvey['aError'] = $aError;

$redata = array();
$redata['thissurvey'] = $thissurvey;

echo templatereplace(file_get_contents($sTemplateViewPath."layout_errors.twig"), array(), $redata);
Expand Down
4 changes: 2 additions & 2 deletions templates/default/views/layout_errors.twig
Expand Up @@ -103,9 +103,9 @@
<body class="default lang-{{surveylanguage}} {{surveyformat}}" marginwidth="0" marginheight="0">
<div id="block_error">
<div>
<h2>{{ aError.title | t }}</h2>
<h2>{{ aError.title }}</h2>
<p>
{{ aError.message | t }}
{{ aError.message }}
</p>
<p>
{{"For further information please contact"| t }} {{ aSurveyInfo.adminname }}:<br>
Expand Down

0 comments on commit de9b84c

Please sign in to comment.