String translation is mandatory; use it and love it

Last modified: August 23, 2008 - 17:24

String Accessibility

Drupal is available to every country in the world, and while we code it in English, it's textual string outputs get translated to almost any language you can think of. The t() function is mandatory for all text strings that will be read by a user or an admin, as it's the only way core can re-translate those strings into something legible to the readers.

String Security

t() is essential for localization, but also has important security functionality that every Drupal developer should know about and understand. It's much easier to just wrap all user-facing text in t() in the first place than it is to go back in after the fact and t()-ify your code if/when you (or someone else) decides they want to use it in another language.

 
 

Drupal is a registered trademark of Dries Buytaert.