fix: translate moderator message

pull/83/head
sualko 2020-09-22 16:08:14 +02:00
parent 17b66c3ae0
commit a72c877f6b
1 changed files with 8 additions and 2 deletions

View File

@ -16,6 +16,7 @@ use OCA\BigBlueButton\Permission;
use OCA\BigBlueButton\Crypto; use OCA\BigBlueButton\Crypto;
use OCP\IConfig; use OCP\IConfig;
use OCP\IURLGenerator; use OCP\IURLGenerator;
use OCP\IL10N;
class API { class API {
/** @var IConfig */ /** @var IConfig */
@ -36,18 +37,23 @@ class API {
/** @var IEventDispatcher */ /** @var IEventDispatcher */
private $eventDispatcher; private $eventDispatcher;
/** @var IL10N */
private $l10n;
public function __construct( public function __construct(
IConfig $config, IConfig $config,
IURLGenerator $urlGenerator, IURLGenerator $urlGenerator,
Permission $permission, Permission $permission,
Crypto $crypto, Crypto $crypto,
IEventDispatcher $eventDispatcher IEventDispatcher $eventDispatcher,
IL10N $l10n
) { ) {
$this->config = $config; $this->config = $config;
$this->urlGenerator = $urlGenerator; $this->urlGenerator = $urlGenerator;
$this->permission = $permission; $this->permission = $permission;
$this->crypto = $crypto; $this->crypto = $crypto;
$this->eventDispatcher = $eventDispatcher; $this->eventDispatcher = $eventDispatcher;
$this->l10n = $l10n;
} }
private function getServer() { private function getServer() {
@ -127,7 +133,7 @@ class API {
$createMeetingParams->setRecordingReadyCallbackUrl($recordingReadyUrl); $createMeetingParams->setRecordingReadyCallbackUrl($recordingReadyUrl);
$invitationUrl = $this->urlGenerator->linkToRouteAbsolute('bbb.join.index', ['token' => $room->uid]); $invitationUrl = $this->urlGenerator->linkToRouteAbsolute('bbb.join.index', ['token' => $room->uid]);
$createMeetingParams->setModeratorOnlyMessage('To invite someone to the meeting, send them this link: ' . $invitationUrl); $createMeetingParams->setModeratorOnlyMessage($this->l10n->t('To invite someone to the meeting, send them this link: %s', [$invitationUrl]));
if (!empty($room->welcome)) { if (!empty($room->welcome)) {
$createMeetingParams->setWelcomeMessage($room->welcome); $createMeetingParams->setWelcomeMessage($room->welcome);