Skip to content
Snippets Groups Projects
Commit 09b8adf4 authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

[TASK] Translated upload error handling

parent 9643dd05
No related branches found
No related tags found
No related merge requests found
......@@ -428,7 +428,7 @@ class JoblistController extends ActionController {
try {
$uniqueFolderName = $this->request->getArgument('folderName');
} catch (NoSuchArgumentException $exception) {
$exceptionMessage = 'Some file could not be uploaded. Is it too large?';
$exceptionMessage = LocalizationUtility::translate('error.NoSuchArgumentException', 'sg_jobs');
if (version_compare(
\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(),
......@@ -722,7 +722,7 @@ class JoblistController extends ActionController {
$filePathInfo = PathUtility::pathinfo($singleUploadedArr['path']);
$namesToMove[] = $filePathInfo['basename'];
if (!GeneralUtility::inList($allowedFileExtensions, strtolower($filePathInfo['extension']))) {
throw new TypeConverterException('File extension is not allowed!', 1399312430);
throw new TypeConverterException(LocalizationUtility::translate('error.TypeConverterException.type', 'sg_jobs'), 1399312430);
}
if (!$newFolder->hasFile($filePathInfo['basename'])) {
......@@ -735,7 +735,6 @@ class JoblistController extends ActionController {
$fileReference = $this->fileAndFolderService->createFileReferenceFromFalFileObject($usableFile);
if ($fileReference) {
// @todo: make this more dynamic
if ($singleFilePostKey === 'coverLetter') {
$applicationData->setCoverLetter($fileReference);
}
......@@ -749,7 +748,7 @@ class JoblistController extends ActionController {
continue;
}
} else {
throw new TypeConverterException('Missing file ' . $singleFilePostKey, 1399312430);
throw new TypeConverterException(LocalizationUtility::translate('error.TypeConverterException.missing.'.$singleFilePostKey, 'sg_jobs'), 1399312430);
}
}
}
......
......@@ -150,6 +150,30 @@
<source><![CDATA[The selected file exceeds the maximum file size]]></source>
<target><![CDATA[Die ausgewählte Datei ist zu groß!]]></target>
</trans-unit>
<trans-unit id="error.NoSuchArgumentException">
<source><![CDATA[Some file could not be uploaded. Is it too large?]]></source>
<target><![CDATA[Einige Dateien konnten nicht hochgeladen werden. Ist eine Datei zu groß?]]></target>
</trans-unit>
<trans-unit id="error.TypeConverterException.type">
<source><![CDATA[File extension is not allowed!]]></source>
<target><![CDATA[Dateityp nicht erlaubt!]]></target>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.">
<source><![CDATA[Missing file %s]]></source>
<target><![CDATA[Eine Datei fehlt]]></target>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.coverLetter">
<source><![CDATA[Missing coverletter file]]></source>
<target><![CDATA[Datei für Motivationsschreiben fehlt]]></target>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.cv">
<source><![CDATA[Missing cv file]]></source>
<target><![CDATA[Datei für Lebenslauf fehlt]]></target>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.certificate">
<source><![CDATA[Missing certificate file]]></source>
<target><![CDATA[Datei für Zeugnis fehlt]]></target>
</trans-unit>
<trans-unit id="frontend.allVacancies" approved="yes">
<source><![CDATA[All vacancies]]></source>
<target><![CDATA[Alle offenen Stellen]]></target>
......
......@@ -114,6 +114,24 @@
<trans-unit id="error.maxFileSizeMessage">
<source><![CDATA[The selected file exceeds the maximum file size]]></source>
</trans-unit>
<trans-unit id="error.NoSuchArgumentException">
<source><![CDATA[Some file could not be uploaded. Is it too large?]]></source>
</trans-unit>
<trans-unit id="error.TypeConverterException.type">
<source><![CDATA[File extension is not allowed!]]></source>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.">
<source><![CDATA[Missing some file]]></source>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.coverLetter">
<source><![CDATA[Missing coverletter file]]></source>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.cv">
<source><![CDATA[Missing cv file]]></source>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.certificate">
<source><![CDATA[Missing certificate file]]></source>
</trans-unit>
<trans-unit id="frontend.allVacancies">
<source><![CDATA[All vacancies]]></source>
</trans-unit>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment