From bb6e0b5186a6115d9e78f596270114febb1f9b46 Mon Sep 17 00:00:00 2001 From: Joshua Dwire Date: Thu, 24 Mar 2016 18:45:00 -0400 Subject: [PATCH] Make dropzone translatable --- resources/lang/en/texts.php | 12 +++++++++++- resources/views/expenses/edit.blade.php | 4 +++- resources/views/invoices/edit.blade.php | 4 +++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 3c7b2dcacc42..2de42322b39f 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -1104,12 +1104,22 @@ $LANG = array( 'email_documents_example_2' => 'Final Deliverable.zip', 'invoice_documents' => 'Attached Documents', 'expense_documents' => 'Attached Documents', - 'document_upload_message' => 'Drop files here or click to upload.', 'invoice_embed_documents' => 'Embed Documents', 'invoice_embed_documents_help' => 'Include attached images in the invoice.', 'document_email_attachment' => 'Attach Documents', 'download_documents' => 'Download Documents (:size)', 'documents_from_expenses' => 'From Expenses:', + 'dropzone' => array(// See http://www.dropzonejs.com/#config-dictDefaultMessage + 'DefaultMessage' => 'Drop files or click to upload', + 'FallbackMessage' => 'Your browser does not support drag\'n\'drop file uploads.', + 'FallbackText' => 'Please use the fallback form below to upload your files like in the olden days.', + 'FileTooBig' => 'File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.', + 'InvalidFileType' => 'You can\'t upload files of this type.', + 'ResponseError' => 'Server responded with {{statusCode}} code.', + 'CancelUpload' => 'Cancel upload', + 'CancelUploadConfirmation' => 'Are you sure you want to cancel this upload?', + 'RemoveFile' => 'Remove file', + ), 'documents' => 'Documents', 'document_date' => 'Document Date', 'document_size' => 'Size', diff --git a/resources/views/expenses/edit.blade.php b/resources/views/expenses/edit.blade.php index 5aaae895fbfa..dcf081064e56 100644 --- a/resources/views/expenses/edit.blade.php +++ b/resources/views/expenses/edit.blade.php @@ -231,8 +231,10 @@ }, acceptedFiles:{!! json_encode(implode(',',\App\Models\Document::$allowedMimes)) !!}, addRemoveLinks:true, + @foreach(trans('texts.dropzone') as $key=>$text) + "dict{{strval($key)}}":"{{strval($text)}}", + @endforeach maxFileSize:{{floatval(MAX_DOCUMENT_SIZE/1000)}}, - dictDefaultMessage:{!! json_encode(trans('texts.document_upload_message')) !!} }); if(dropzone instanceof Dropzone){ dropzone.on("addedfile",handleDocumentAdded); diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index c6aaa7230309..de0c6891ed44 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -951,8 +951,10 @@ }, acceptedFiles:{!! json_encode(implode(',',\App\Models\Document::$allowedMimes)) !!}, addRemoveLinks:true, + @foreach(trans('texts.dropzone') as $key=>$text) + "dict{{strval($key)}}":"{{strval($text)}}", + @endforeach maxFileSize:{{floatval(MAX_DOCUMENT_SIZE/1000)}}, - dictDefaultMessage:{!! json_encode(trans('texts.document_upload_message')) !!} }); if(dropzone instanceof Dropzone){ dropzone.on("addedfile",handleDocumentAdded);