function get_t

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 bootstrap.inc get_t()
cle7 bootstrap.inc get_t()
elmsmedia7 bootstrap.inc get_t()
icor7 bootstrap.inc get_t()
meedjum_blog7 bootstrap.inc get_t()
mooc7 bootstrap.inc get_t()

Returns the name of the proper localization function.

get_t() exists to support localization for code that might run during the installation phase, when some elements of the system might not have loaded.

This would include implementations of hook_install(), which could run during the Drupal installation phase, and might also be run during non-installation time, such as while installing the module from the the module administration page.

Example usage:

  $t = get_t();
  $translated = $t('translate this');

Use t() if your code will never run during the Drupal installation phase. Use st() if your code will only run during installation and never any other time. Use get_t() if your code could run in either circumstance.

See also

t()

st()

Related topics

51 calls to get_t()
advagg_css_cdn_requirements in sites/all/modules/ulmus/advagg/advagg_css_cdn/advagg_css_cdn.install
Implements hook_requirements().
advagg_css_compress_requirements in sites/all/modules/ulmus/advagg/advagg_css_compress/advagg_css_compress.install
Implements hook_requirements().
advagg_install_check_via_http in sites/all/modules/ulmus/advagg/advagg.install
Make sure http requests to css/js files work correctly.
advagg_js_cdn_requirements in sites/all/modules/ulmus/advagg/advagg_js_cdn/advagg_js_cdn.install
Implements hook_requirements().
advagg_js_compress_requirements in sites/all/modules/ulmus/advagg/advagg_js_compress/advagg_js_compress.install
Implements hook_requirements().

... See full list

File

includes/bootstrap.inc, line 2635
Functions that need to be loaded on every Drupal request.

Code

function get_t() {
  static $t;
  // This is not converted to drupal_static because there is no point in
  // resetting this as it can not change in the course of a request.
  if (!isset($t)) {
    $t = drupal_installation_attempted() ? 'st' : 't';
  }
  return $t;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.