X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseModule.php;h=be4788045c2d283d73c5c30080c1ebf661ee7710;hb=f00792d370cfbf1d52b37e3eed7e80e682df9d8a;hp=76458c6c681d3c4880894d465ef78ff18c0d4501;hpb=489cd0884ade34932fee45f136f77949bb3e3f91;p=friendica.git diff --git a/src/BaseModule.php b/src/BaseModule.php index 76458c6c68..be4788045c 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -22,6 +22,7 @@ namespace Friendica; use Friendica\Capabilities\ICanHandleRequests; +use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Model\User; @@ -37,18 +38,35 @@ use Friendica\Model\User; abstract class BaseModule implements ICanHandleRequests { /** @var array */ - protected static $parameters = []; + protected $parameters = []; - public function __construct(array $parameters = []) + /** @var L10n */ + protected $l10n; + + public function __construct(L10n $l10n, array $parameters = []) { - static::$parameters = $parameters; + $this->parameters = $parameters; + $this->l10n = $l10n; } /** - * {@inheritDoc} + * Wraps the L10n::t() function for Modules + * + * @see L10n::t() + */ + protected function t(string $s, ...$args): string + { + return $this->l10n->t($s, $args); + } + + /** + * Wraps the L10n::tt() function for Modules + * + * @see L10n::tt() */ - public function init() + protected function tt(string $singular, string $plurarl, int $count): string { + return $this->l10n->tt($singular, $plurarl, $count); } /** @@ -90,13 +108,6 @@ abstract class BaseModule implements ICanHandleRequests // DI::baseurl()->redirect('module'); } - /** - * {@inheritDoc} - */ - public function afterpost() - { - } - /** * {@inheritDoc} */