Some translations.

This commit is contained in:
James Cole 2015-07-25 16:48:32 +02:00
parent 43892da07e
commit 3c65c28936
5 changed files with 23 additions and 55 deletions

View File

@ -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;
}

BIN
public/images/image.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

View File

@ -405,6 +405,14 @@ return [
'tag_title_nothing' => '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' .
' <span class="label label-info">expensive</span>, <span class="label label-info">bill</span>' .
' or <span class="label label-info">for-party</span>. 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 <span class="label label-success">' .
'Christmas dinner with friends</span> 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. ',
];

View File

@ -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. ' .
'<span class="label label-info">dure-aanschaf</span>, <span class="label label-info">rekening</span>, ' .
'<span class="label label-info">feestje</span>. 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 <span class="label label-success">Kerstdiner</span> maken en informatie over' .
' het restaurant meenemen. Zulke tags zijn enkelvoudig; je gebruikt ze maar bij één gelegenheid.',
];

View File

@ -17,17 +17,11 @@
</div>
<div class="box-body">
<p>
Usually tags are singular words, designed to quickly band items together
using things like <span class="label label-info">expensive</span>,
<span class="label label-info">bill</span> or
<span class="label label-info">for-party</span>. 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 <span class="label label-success">Christmas dinner with friends</span>
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'|_ }}
</p>
<p>
{{'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