1. Use the StringTranslationTrait in Drupal\Core\Controller\ExceptionController
  2. Add string_translation as argument in core.services.yml
  3. In ExceptionController's constructor assign $this->stringTranslation
  4. Replace every t() with $this->t()

Comments

martin107’s picture

Assigned: Unassigned » martin107

Ok, I'll bite

martin107’s picture

StatusFileSize
new2.33 KB

Passes Drupal\Tests\Core\Controller\ExceptionControllerTest locally

martin107’s picture

Status: Active » Needs work
martin107’s picture

Status: Needs work » Needs review
martin107’s picture

StatusFileSize
new2.33 KB

Ah that what I want!

martin107’s picture

Assigned: martin107 » Unassigned
Issue summary: View changes

There was no need to implement the following step in the TODO list

Add string_translation as argument in core.services.yml

ParisLiakos’s picture

Assigned: Unassigned » amitaibu
Issue summary: View changes
Status: Needs review » Needs work

thanks!

+++ b/core/lib/Drupal/Core/Controller/ExceptionController.php
@@ -19,12 +19,14 @@
+  ¶

unneeded space :)

Also 2 and 3 from issue summary are not done (injecting the service, you can check Drupal\Core\Controller\TitleResolver for an example)

ParisLiakos’s picture

Assigned: amitaibu » Unassigned

eer, x-post and the assigned field went nuts:P

martin107’s picture

Status: Needs work » Needs review
StatusFileSize
new3.7 KB
new5.34 KB

Ok fixed.

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

thank you!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

  • Commit d6d80fb on 8.x by webchick:
    Issue #2257745 by martin107 | ParisLiakos: Switch t() to ->t() in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.