Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As per trait StringTranslationTrait the string translation service should be injected if possible.
Comment | File | Size | Author |
---|---|---|---|
#8 | inject_string_translation_service-2563099-8.patch | 7.58 KB | morenstrat |
Comments
Comment #2
morenstratComment #4
morenstratUpdated the failing tests. These are my first attempts at d8 tests, so I'm not sure if I'm doing things right. Any form of guidance is welcome.
Comment #6
Mile23Moving to 8.2.x since this is a code change.
Patch applies, oddly enough. :-)
Re-running the testbot to see if it still works.
Just one thing to review at the moment:
StringTranslationTrait
hassetStringTranslation()
, which we should use.Comment #7
Mile23Comment #8
morenstratUpdated patch using
$this->setStringTranslation()
.Comment #9
morenstratComment #10
Mile23Cool, thanks.
Addressed #6, patch applies, tests are green.
There's still this kind of thing:
It'd be nice to use
TranslationInterface::class
instead of the literal string, but then it would be different from all the other mocks in the test. So favoring consistency let's RTBC. Maintainers can of course disagree and send it back.Comment #11
Wim LeersComment #13
Wim LeersLooks like something was wrong with this DrupalCI instance. Re-testing.
Comment #15
catchI think it's OK to do the test changes later.
Committed 0745511 and pushed to 8.2.x. Thanks!