From 3c65c28936eb1acd6dc567af26724cb5b2d8309b Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 25 Jul 2015 16:48:32 +0200 Subject: [PATCH] Some translations. --- app/Http/Controllers/AttachmentController.php | 54 +++--------------- public/images/image.png | Bin 0 -> 516 bytes resources/lang/en/firefly.php | 8 +++ resources/lang/nl/firefly.php | 6 ++ resources/twig/tags/index.twig | 10 +--- 5 files changed, 23 insertions(+), 55 deletions(-) create mode 100755 public/images/image.png diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index 494cb1b763..69ba05f14f 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -4,13 +4,14 @@ namespace FireflyIII\Http\Controllers; use Crypt; +use File; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Http\Requests\AttachmentFormRequest; use FireflyIII\Models\Attachment; use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; -use FireflyIII\Support\CacheProperties; use Input; use Preferences; +use Response; use Session; use URL; use View; @@ -119,54 +120,13 @@ class AttachmentController extends Controller /** * @param Attachment $attachment */ - public function preview(AttachmentHelperInterface $helper, Attachment $attachment) + public function preview(Attachment $attachment) { - if (!function_exists('imagecreatetruecolor')) { - abort(500); - } + $file = public_path('images/image.png'); + $response = Response::make(File::get($file)); + $response->header('Content-Type', 'image/png'); - - $mime = $attachment->mime; - $cache = new CacheProperties; - $cache->addProperty('preview-attachment'); - $cache->addProperty($attachment->id); - if ($cache->has()) { - header('Content-Type: image/png'); - - return $cache->get(); - } - - switch ($mime) { - default: - $img = imagecreatetruecolor(100, 10); - imagesavealpha($img, true); - - $trans_colour = imagecolorallocatealpha($img, 0, 0, 0, 127); - imagefill($img, 0, 0, $trans_colour); - header('Content-Type: image/png'); - imagepng($img); - imagedestroy($img); - $cache->store($img); - exit; - break; - case 'image/jpeg': - case 'image/png': - $img = imagecreatetruecolor(100, 100); - $source = $helper->getAttachmentLocation($attachment); - $decrypt = Crypt::decrypt(file_get_contents($source)); - $original = imagecreatefromstring($decrypt); - $width = imagesx($original); - $height = imagesy($original); - - imagecopyresampled($img, $original, 0, 0, 0, 0, 100, 100, $width, $height); - - header('Content-Type: image/png'); - imagepng($img); - imagedestroy($img); - exit; - - break; - } + return $response; } diff --git a/public/images/image.png b/public/images/image.png new file mode 100755 index 0000000000000000000000000000000000000000..fc3c393caa3bc4371d12d0c67ffd6d333ecf1d8e GIT binary patch literal 516 zcmV+f0{i`mP)0oSgT$J*kO*Aq9I~CW*s{G*(t$KS{OS+#aO%?udUme<*TTEO`Fr@r_QT zk=#}u-n~>Vm!+9S1PE{@3<)G~CPb<$Za;W?3+O}|+q)?*Pn355=}S(XIZmEANjZci zf5 zj<%@MX^bD1^BwlS^+AD|$dm-1wial0hwPI;CDM?Y9SXW#@w-UF0SQ8OgplRTleOB2 zUjkDS|0U9pI|lSN*EvXUa~*UIclJdZ#)Npbwh9>YT?Z;=B8|l&^t~P~om?<5Lre$+ z;%`P>SL7`djY#8Y9$wv9dv|3p) 'Default tags', 'tag_title_balancingAct' => 'Balancing act tags', 'tag_title_advancePayment' => 'Advance payment tags', + 'tags_introduction' => 'Usually tags are singular words, designed to quickly band items together using things like' . + ' expensive, bill' . + ' or for-party. In Firefly III, tags can have more properties' . + ' such as a date, description and location. This allows you to join transactions together in a more' . + ' meaningful way. For example, you could make a tag called ' . + 'Christmas dinner with friends and add information about the restaurant. Such tags are "singular",' . + ' you would only use them for a single occasion, perhaps with multiple transactions.', + 'tags_group' => 'Tags group transactions together, which makes it possible to store reimbursements (in case you front money for others) and other "balancing acts" where expenses are summed up (the payments on your new TV) or where expenses and deposits are cancelling each other out (buying something with saved money). It\'s all up to you. Using tags the old-fashioned way is of course always possible. ', ]; diff --git a/resources/lang/nl/firefly.php b/resources/lang/nl/firefly.php index eee51f3e65..dbfa8a0bfa 100644 --- a/resources/lang/nl/firefly.php +++ b/resources/lang/nl/firefly.php @@ -420,5 +420,11 @@ return [ 'tag_title_nothing' => 'Standaard tags', 'tag_title_balancingAct' => 'Balancing act tags', 'tag_title_advancePayment' => 'Advance payment tags', + 'tags_introduction' => 'Normaal gesproken zijn tags enkele woorden, gebruikt om gerelateerde zaken snel aan elkaar te plakken. ' . + 'dure-aanschaf, rekening, ' . + 'feestje. In Firefly III hebben tags meer betekenis en kan je er een datum' . + ', beschrijving en locatie aan geven. Daarmee kan je je transacties op een wat zinvollere manier aan elkaar ' . + 'koppelen. Je kan bijvoorbeeld een tag Kerstdiner maken en informatie over' . + ' het restaurant meenemen. Zulke tags zijn enkelvoudig; je gebruikt ze maar bij één gelegenheid.', ]; diff --git a/resources/twig/tags/index.twig b/resources/twig/tags/index.twig index 6290435ff1..8257f8ac5b 100644 --- a/resources/twig/tags/index.twig +++ b/resources/twig/tags/index.twig @@ -17,17 +17,11 @@

- Usually tags are singular words, designed to quickly band items together - using things like expensive, - bill or - for-party. In Firefly III, tags can have more properties - such as a date, description and location. This allows you to join transactions together in a more meaningful - way. For example, you could make a tag called Christmas dinner with friends - and add information about the restaurant. Such tags are "singular", you would only use them for a single occasion, - perhaps with multiple transactions. + {{ 'tags_introduction'|_ }}

+ {{'tags_group'|_ }} Tags group transactions together, which makes it possible to store reimbursements (in case you front money for others) and other "balancing acts" where expenses are summed up (the payments on your new TV) or where expenses and deposits