function 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.

@todo Remove this in favor of t().

See also

t()

st()

Related topics

28 calls to get_t()
aggregator_requirements in drupal/core/modules/aggregator/aggregator.install
Implements hook_requirements().
batch_process in drupal/core/includes/form.inc
Processes the batch.
batch_set in drupal/core/includes/form.inc
Adds a new batch.
CountryManager::getStandardList in drupal/core/lib/Drupal/Core/Locale/CountryManager.php
Get an array of all ISO 3166-1 alpha-2 country code => country name pairs.
form_pre_render_conditional_form_element in drupal/core/includes/form.inc
Adds form element theming to an element if its title or description is set.

... See full list

File

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

Code

function get_t() {
  return 't';
}