Skip to content

Commit

Permalink
Fixed issue #8271: quexf-pdf export: "Section" is not translated
Browse files Browse the repository at this point in the history
  • Loading branch information
adamzammit committed Oct 14, 2013
1 parent 524f16e commit daee3cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions application/controllers/admin/export.php
Expand Up @@ -1040,6 +1040,8 @@ public function showquexmlsurvey()
Yii::import("application.libraries.admin.quexmlpdf", TRUE);
$quexmlpdf = new quexmlpdf($this->getController());

$quexmlpdf->setLanguage($surveyprintlang);

set_time_limit(120);

$noheader = TRUE;
Expand Down
15 changes: 14 additions & 1 deletion application/libraries/admin/quexmlpdf.php
Expand Up @@ -40,6 +40,11 @@ class quexmlpdf extends pdf {
*/
const INCH_IN_MM = 25.4;

/**
* Language for translation
*/
protected $language = "en";

/**
* Pixels per inch of exported document
*
Expand Down Expand Up @@ -715,6 +720,12 @@ class quexmlpdf extends pdf {
*/
protected $sectionHeight = 18;

public function setLanguage($language)
{
if (!empty($language))
$this->language = $language;
}

/**
* Return the length of the longest word
*
Expand Down Expand Up @@ -1325,6 +1336,8 @@ public function getQuestionnaireId()
*/
public function createqueXML($quexml)
{
$clang = new limesurvey_lang($this->languauge);

$xml = new SimpleXMLElement($quexml);

$q = array();
Expand Down Expand Up @@ -1356,7 +1369,7 @@ public function createqueXML($quexml)
{
$stmp = array();
$sl = $this->numberToLetter($scount);
$stmp['title'] = "Section " . $sl;
$stmp['title'] = $clang->gT("Section") . " " . $sl;
$stmp['info'] = "";
$stmp['text'] = "";

Expand Down

0 comments on commit daee3cb

Please sign in to comment.