Skip to main content
1 of 1
user avatar
user avatar

There's no right or wrong t because at the end of the day you end up using the translate method of the string_translation service. Passing around objects are pretty pointless because the StringTranslationTrait and t both execute the exact same code: \Drupal::service('string_translation')->translate($string, $args, $options). The call chain is different of course but at the end of the day, that's the exact call they both run.

user49