Comments

dishabhadra created an issue. See original summary.

dishabhadra’s picture

Status: Active » Needs review
StatusFileSize
new3.71 KB
philipnorton42’s picture

I can confirm that this patch applies correctly and that the code changes work.

dpacassi’s picture

Status: Needs review » Reviewed & tested by the community

I also tested this patch on 8.2.x-dev and it works correctly as expected.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Thank you for your work on cleaning up Drupal core's use of deprecated APIs!

In order to deprecate APIs in a maintainable way, converting deprecated uses should be replaced across all of core for a given kind of usage, rather than in individual modules or files. Such issues should also always be part of an overall plan to ensure all usages are removed, rather than standalone patches. Such a plan may already exist for t() so this issue should probably be closed in favor of that.

For background information on why we usually will not commit cleanups that aren't scoped in that way, see the core issue scope guidelines. See #2575081: [policy, no patch] Use E_USER_DEPRECATED in Drupal 8 minor releases for more information on how we plan to manage deprecations in the future.

Contributing to the overall plan above will help ensure that your cleanups for core's deprecated code improve core in a maintainable and minimally disruptive way.

For this issue, we should start by replacing non-test t() usages in all classes where the translation trait or service is already available. This can be done with a script. We would then have a followup to inject the service in classes where it is not already available and convert usages there. Finally, we should have a separate issue to discuss the use of t() in tests. We probably should close this issue as a duplicate, but setting to needs work for now so that contributors see this information. Thanks!

You might want to help contribute to this issue instead: #2549805: [Meta] Remove all usage of FormattableMarkup in tests apart from explicit tests of that API

mallezie’s picture

Status: Needs work » Closed (duplicate)