mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various code cleanup.
This commit is contained in:
@@ -57,6 +57,14 @@ class Translation extends Twig_Extension
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return 'FireflyIII\Support\Twig\Translation';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Twig_SimpleFunction
|
||||
*/
|
||||
@@ -64,9 +72,9 @@ class Translation extends Twig_Extension
|
||||
{
|
||||
return new Twig_SimpleFunction(
|
||||
'journalLinkTranslation', function (int $linkTypeId, string $direction, string $original) {
|
||||
$key = sprintf('firefly.%d_%s', $linkTypeId, $direction);
|
||||
$key = sprintf('firefly.%d_%s', $linkTypeId, $direction);
|
||||
$translation = trans($key);
|
||||
if($key === $translation) {
|
||||
if ($key === $translation) {
|
||||
return $original;
|
||||
}
|
||||
|
||||
@@ -76,12 +84,4 @@ class Translation extends Twig_Extension
|
||||
}, ['is_safe' => ['html']]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return 'FireflyIII\Support\Twig\Translation';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user