therealssj / tfa

TFA 8.x fork
0 stars 0 forks source link

Use t() method instead of relying on the global t() function #4

Open paraacha opened 8 years ago

paraacha commented 8 years ago

Since FormBase includes the StringTranslationTrait trait, all forms in the TFA module can (and should) rely upon the t() method.

So a simple replacement of all occurrences of t('...') with $this->t('...') in the form classes is what's required.

Though this issue is minor, but it is in accordance with the OOP best practices which encourage the usage of class methods instead of global functions.

For more information: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21StringTranslation%21StringTranslationTrait.php/trait/StringTranslationTrait/8.2.x

nerdstein commented 8 years ago

I agree with this as well. It is a low priority