You are here

function t_safe in Devel 7

Same name and namespace in other branches
  1. 5 devel.module \t_safe()
  2. 6 devel.module \t_safe()

Gets the t() function if available, uses strtr() as a fallback.

5 calls to t_safe()
devel_drupal_goto_alter in ./devel.module
Implements hook_drupal_goto_alter().
devel_query_summary in ./devel.module
Returns the query summary.
devel_shutdown_memory in ./devel.module
Returns the rendered memory usage.
devel_shutdown_summary in ./devel.module
Returns the rendered shutdown summary.
devel_timer in ./devel.module
Displays page execution time at the bottom of the page.

File

./devel.module, line 1341
This module holds functions useful for Drupal development.

Code

function t_safe($string, $args) {

  // get_t() caused problems here with the theme registry after changing on
  // admin/build/modules. The theme_get_registry() call is needed!
  if (function_exists('t') && function_exists('theme_get_registry')) {
    theme_get_registry();
    return t($string, $args);
  }
  else {
    return strtr($string, $args);
  }
}