You are here

function st in Drupal 5

Same name and namespace in other branches
  1. 6 includes/install.inc \st()
  2. 7 includes/install.inc \st()

Hardcoded function for doing the equivalent of theme('placeholder') when the theme system is not available.

20 calls to st()
default_profile_final in profiles/default/default.profile
Perform any final installation tasks for this profile.
drupal_rewrite_settings in includes/install.inc
Read settings.php into a buffer line by line, changing values specified in $settings array, then over-writing the old settings.php file.
drupal_test_mysql in includes/install.mysql.inc
Check if we can connect to MySQL.
drupal_test_mysqli in includes/install.mysqli.inc
Check if we can connect to MySQL.
drupal_test_pgsql in includes/install.pgsql.inc
Check if we can connect to PostgreSQL.

... See full list

1 string reference to 'st'
get_t in includes/bootstrap.inc
Return the name of the localisation function. Use in code that needs to run both during installation and normal operation.

File

includes/install.inc, line 582

Code

function st($string, $args = array()) {
  static $locale_strings = NULL;
  global $profile, $install_locale;
  if (!isset($locale_strings)) {
    $locale_strings = array();
    $filename = './profiles/' . $profile . '/' . $install_locale . '.po';
    if (file_exists($filename)) {
      require_once './includes/locale.inc';
      $file = (object) array(
        'filepath' => $filename,
      );
      _locale_import_read_po('mem-store', $file);
      $locale_strings = _locale_import_one_string('mem-report');
    }
  }
  require_once './includes/theme.inc';
  $GLOBALS['theme'] = 'theme';

  // Transform arguments before inserting them
  foreach ($args as $key => $value) {
    switch ($key[0]) {

      // Escaped only
      case '@':
        $args[$key] = check_plain($value);
        break;

      // Escaped and placeholder
      case '%':
      default:
        $args[$key] = '<em>' . check_plain($value) . '</em>';
        break;

      // Pass-through
      case '!':
    }
  }
  return strtr(!empty($locale_strings[$string]) ? $locale_strings[$string] : $string, $args);
}