Skip to content

Commit

Permalink
fix: put in welsh translation key
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed7752 committed Feb 5, 2025
1 parent c9cbaf3 commit 5908860
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Common\Service\Helper\FormHelperService;
use Common\Service\Helper\RestrictionHelperService;
use Common\Service\Helper\StringHelperService;
use Common\Service\Helper\TranslationHelperService;
use Dvsa\Olcs\Application\Controller\UploadEvidenceController;
use Dvsa\Olcs\Utils\Translation\NiTextTranslation;
use Psr\Container\ContainerInterface;
Expand All @@ -22,6 +23,7 @@ class UploadEvidenceControllerFactory implements FactoryInterface
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null): UploadEvidenceController
{
$translationHelper = $container->get(TranslationHelperService::class);
$niTextTranslationUtil = $container->get(NiTextTranslation::class);
$authService = $container->get(AuthorizationService::class);
$formHelper = $container->get(FormHelperService::class);
Expand All @@ -35,7 +37,8 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
$formHelper,
$restrictionHelper,
$stringHelper,
$uploadHelper
$uploadHelper,
$translationHelper
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Common\Service\Helper\FormHelperService;
use Common\Service\Helper\RestrictionHelperService;
use Common\Service\Helper\StringHelperService;
use Common\Service\Helper\TranslationHelperService;
use Dvsa\Olcs\Utils\Translation\NiTextTranslation;
use Olcs\Controller\Lva\AbstractUploadEvidenceController;
use Olcs\Controller\Lva\Traits\ApplicationControllerTrait;
Expand Down Expand Up @@ -34,13 +35,15 @@ public function __construct(
FormHelperService $formHelper,
protected RestrictionHelperService $restrictionHelper,
protected StringHelperService $stringHelper,
FileUploadHelperService $uploadHelper
FileUploadHelperService $uploadHelper,
TranslationHelperService $translationHelper,
) {
parent::__construct(
$niTextTranslationUtil,
$authService,
$formHelper,
$uploadHelper
$uploadHelper,
$translationHelper
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Common\RefData;
use Common\Service\Helper\FileUploadHelperService;
use Common\Service\Helper\FormHelperService;
use Common\Service\Helper\TranslationHelperService;
use DateTimeImmutable;
use DateTimeInterface;
use Dvsa\Olcs\Transfer\Query\Application\UploadEvidence;
Expand All @@ -27,6 +28,8 @@ abstract class AbstractUploadEvidenceController extends AbstractController

protected $operatingCentreId;

protected TranslationHelperService $translationHelper;

/**
* Data from API
* @var array
Expand All @@ -45,19 +48,22 @@ abstract class AbstractUploadEvidenceController extends AbstractController
* @param AuthorizationService $authService
* @param FormHelperService $formHelper
* @param FileUploadHelperService $uploadHelper
* @param TranslationHelperService $translationHelper
*/
public function __construct(
NiTextTranslation $niTextTranslationUtil,
AuthorizationService $authService,
protected FormHelperService $formHelper,
FileUploadHelperService $uploadHelper
FileUploadHelperService $uploadHelper,
TranslationHelperService $translationHelper
) {
$this->uploadHelper = $uploadHelper;
$this->startTime = (new DateTimeImmutable())->format(DateTimeInterface::ATOM);

$this->translationHelper = $translationHelper;
parent::__construct(
$niTextTranslationUtil,
$authService
$authService,
$translationHelper
);
}

Expand Down Expand Up @@ -87,7 +93,9 @@ public function indexAction()
\Dvsa\Olcs\Transfer\Command\Application\UploadEvidence::create($dtoData)
);
if ($result->isOk()) {
$this->addSuccessMessage('Your document upload was successful');
dd($this->getData());
$message = $this->translationHelper->translate('lva-financial-evidence-upload-now.success');
$this->addSuccessMessage($message);
return $this->redirect()->toRoute(
'lva-' . $this->lva . '/submission-summary',
['application' => $this->getIdentifier()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Common\Service\Helper\FileUploadHelperService;
use Common\Service\Helper\FormHelperService;
use Common\Service\Helper\TranslationHelperService;
use Dvsa\Olcs\Utils\Translation\NiTextTranslation;
use Psr\Container\ContainerInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
Expand All @@ -24,12 +25,14 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
$authService = $container->get(AuthorizationService::class);
$formHelper = $container->get(FormHelperService::class);
$uploadHelper = $container->get(FileUploadHelperService::class);
$translationHelper = $container->get(TranslationHelperService::class);

return new UploadEvidenceController(
$niTextTranslationUtil,
$authService,
$formHelper,
$uploadHelper
$uploadHelper,
$translationHelper
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Common\Service\Helper\FileUploadHelperService;
use Common\Service\Helper\FormHelperService;
use Common\Service\Helper\TranslationHelperService;
use Dvsa\Olcs\Utils\Translation\NiTextTranslation;
use Olcs\Controller\Lva\AbstractUploadEvidenceController;
use Olcs\Controller\Lva\Traits\VariationControllerTrait;
Expand All @@ -27,13 +28,15 @@ public function __construct(
NiTextTranslation $niTextTranslationUtil,
AuthorizationService $authService,
FormHelperService $formHelper,
FileUploadHelperService $uploadHelper
FileUploadHelperService $uploadHelper,
TranslationHelperService $translationHelper
) {
parent::__construct(
$niTextTranslationUtil,
$authService,
$formHelper,
$uploadHelper
$uploadHelper,
$translationHelper
);
}
}

0 comments on commit 5908860

Please sign in to comment.