Last updated August 14, 2017

Any text that will be displayed to user as part of your application's user interface should be passed through the t() function, or an equivalent, so that it can be translated into other languages as needed. This tutorial will look at how to use the t() function.

This tutorial contains information that applies to anyone writing modules or themes. And many of the tutorials you read on this site and on the web in general will expect that you understand how basic string translation works. In this tutorial we'll look at:

  • Passing strings through the t() function or equivalent so they are available for translation
  • Using placeholders for dynamic content in translatable strings
  • Tips for making your code's interface strings easier to translate