add translation service to container

This commit is contained in:
Uwe Steinmann 2025-10-29 11:09:04 +01:00
parent 5db84c0564
commit caa0e3f139
2 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,7 @@ use Psr\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\MiddlewareInterface;
use DI\ContainerBuilder;
use Slim\Factory\AppFactory;
use Seeddms\Seeddms\Translator;
final class JsonRenderer { /* {{{ */
public function json(
@ -3023,6 +3024,7 @@ final class SeedDMS_TestController { /* {{{ */
}
public function echoData($request, $response, $args) { /* {{{ */
$translator = $this->container->get('translator');
return $this->renderer->json($response, ['success'=>true, 'message'=>'This is the result of the echo call.', 'data'=>$args['data']]);
} /* }}} */
@ -3276,6 +3278,9 @@ $container->set('logger', $logger);
$container->set('fulltextservice', $fulltextservice);
$container->set('notifier', $notifier);
$container->set('authenticator', $authenticator);
$translator = new Translator($settings);
$translator->init();
$container->set('translator', $translator);
$app->setBasePath($settings->_httpRoot."restapi/index.php");

View File

@ -59,6 +59,7 @@ if (true) {
$container->set('fulltextservice', $fulltextservice);
$container->set('notifier', $notifier);
$container->set('authenticator', $authenticator);
$container->set('translator', $translator);
if (isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) {
foreach ($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) {