function t

7.x misc.inc t($str, $vars = array())
6.x misc.inc t($str, $vars = array())
5.x misc.inc t($str, $vars = array())

This function will facilitate translations by using hook_translate()

Allows variable replacements. Use like this: t("@name's blob", array("@name" => "Richard")); or simply t("My blob"); if you don't need replacements.

Not implimented yet.

425 calls to t()
admin.courses.inc in modules/admin/admin.courses.inc
admin.degrees.inc in modules/admin/admin.degrees.inc
admin.groups.inc in modules/admin/admin.groups.inc
admin.module in modules/admin/admin.module
The administrative configurations for FlightPath.
admin_add_degree_form in modules/admin/admin.degrees.inc
This form lets the user add a degree to the database.

... See full list

3 string references to 't'
calendar.module in modules/calendar/calendar.module
calendar_build_custom_calendar in modules/calendar/calendar.module
Actually renders the HTML for the calendar.
calendar_render_mini_calendar in modules/calendar/calendar.module

File

includes/misc.inc, line 2015
This file contains misc functions for FlightPath

Code

function t($str, $vars = array()) {

  // Note: at the moment, this isn't being used, but should one day be set.  
  @$langcode = isset($langcode) ? $langcode : $GLOBALS ["fp_system_settings"]["language"];

  // First, change $str if any other modules implement hook_translate().
  invoke_hook("translate", array(&$str, $langcode, $vars)); // str is passed by ref, so no return needed.

  if (is_array($vars) && count($vars) > 0) {
    foreach ($vars as $var => $val) {

      // If var begins with %, it means we want to italicize the val.
      if (strstr($var, "%")) {
        $val = "<em>$val</em>";
      }

      $str = str_replace($var, $val, $str);
    }
  }

  return $str;
}