Skip to content

Commit

Permalink
Fixed Issue #05089: file upload is not localised during survey taking
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@10027 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Amit Shanker committed May 1, 2011
1 parent 0509615 commit 58c945c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
19 changes: 11 additions & 8 deletions upload.php
Expand Up @@ -56,6 +56,9 @@
die("You don't have a valid session !");
}

$baselang = GetBaseLanguageFromSurveyID($surveyid);
$clang = new limesurvey_lang($baselang);

$randfilename = sRandomChars(15);
$uploaddir = 'tmp/upload/';
$randfileloc = $uploaddir . $randfilename;
Expand All @@ -80,7 +83,7 @@
{
$return = array(
"success" => false,
"msg" => "Sorry, This file extension (".$ext.") is not allowed !"
"msg" => $clang->gT("Sorry, This file extension (").$ext.$clang->gT(") is not allowed !")
);

echo json_encode($return);
Expand All @@ -94,7 +97,7 @@
{
$return = array(
"success" => false,
"msg" => "Sorry, This file is too large. Only files upto ".$maxfilesize." KB are allowed"
"msg" => $clang->gT("Sorry, This file is too large. Only files upto ").$maxfilesize.$clang->gT(" KB are allowed")
);
echo json_encode($return);
}
Expand All @@ -117,7 +120,7 @@
"name" => rawurlencode(basename($filename)),
"ext" => $ext,
"filename" => $randfilename,
"msg" => "The file has been successfuly uploaded."
"msg" => $clang->gT("The file has been successfuly uploaded.")
);
echo json_encode($return);

Expand All @@ -132,7 +135,7 @@
{
$return = array(
"success" => false,
"msg" => "Sorry, This file is too large. Only files upto ".$maxfilesize." KB are allowed"
"msg" => $clang->gT("Sorry, This file is too large. Only files upto ").$maxfilesize.$clang->gT(" KB are allowed")
);
echo json_encode($return);
}
Expand All @@ -156,7 +159,7 @@
"name" => rawurlencode(basename($filename)),
"ext" => $ext,
"filename" => $randfilename,
"msg" => "The file has been successfuly uploaded"
"msg" => $clang->gT("The file has been successfuly uploaded")
);

echo json_encode($return);
Expand All @@ -169,7 +172,7 @@
{
$return = array(
"success" => false,
"msg" => "Sorry, there was an error uplodaing your file"
"msg" => $clang->gT("Sorry, there was an error uplodaing your file")
);

echo json_encode($return);
Expand All @@ -179,7 +182,7 @@
{
$return = array(
"success" => false,
"msg" => "Sorry, This file is too large. Only files upto ".$maxfilesize." KB are allowed"
"msg" => $clang->gT("Sorry, This file is too large. Only files upto ").$maxfilesize.$clang->gT(" KB are allowed")
);

echo json_encode($return);
Expand All @@ -188,7 +191,7 @@
{
$return = array(
"success" => false,
"msg" => "Unknown error"
"msg" => $clang->gT("Unknown error")
);
echo json_encode($return);
}
Expand Down
4 changes: 2 additions & 2 deletions uploader.php
Expand Up @@ -96,10 +96,10 @@
<!-- The upload button -->
<div align="center" class="upload-div">
<button id="button1" class="upload-button" type="button" >Select file</button>
<button id="button1" class="upload-button" type="button" >'.$clang->gT("Select file").'</button>
</div>
<p class="uploadmsg">You can upload '.$qidattributes['allowed_filetypes'].' under '.$qidattributes['max_filesize'].' KB each</p>
<p class="uploadmsg">'.$clang->gT("You can upload ").$qidattributes['allowed_filetypes'].$clang->gT(" under ").$qidattributes['max_filesize'].$clang->gT(" KB each").'</p>
<div class="uploadstatus" id="uploadstatus"></div>
<!-- The list of uploaded files -->
Expand Down

0 comments on commit 58c945c

Please sign in to comment.