st

Versions
mediamosa-21
st($string, $args = array())

Functional equivalent of t(), used when some systems are not available.

Used during the install process, when database, theme, and localization system is possibly not yet available.

See also

t()

▾ 24 functions call st()

coder_upgrade_install in sites/all/modules/coder/coder_upgrade/coder_upgrade.install
Implement hook_install().
drupal_rewrite_settings in includes/install.inc
Replace values in settings.php with values in the submitted array.
drupal_verify_profile in includes/install.inc
Verify an install profile for installation.
hook_install_tasks in modules/system/system.api.php
Return an array of tasks to be performed by an installation profile.
install_already_done_error in includes/install.core.inc
Indicate that Drupal has already been installed.
install_check_requirements in includes/install.core.inc
Check installation requirements and report any errors.
install_configure_form in includes/install.core.inc
Installation task; configure settings for the new site.
install_database_errors in includes/install.core.inc
Check a database connection and return any errors.
install_finished in includes/install.core.inc
Installation task; perform final steps and display a 'finished' page.
install_load_profile in includes/install.core.inc
Installation task; load information about the chosen profile.
install_no_profile_error in includes/install.core.inc
Indicate that there are no profiles available.
install_profile_modules in includes/install.core.inc
Installation task; install required modules via a batch process.
install_select_locale in includes/install.core.inc
Installation task; select which locale to use for the current profile.
install_select_locale_form in includes/install.core.inc
Form API array definition for language selection.
install_select_profile in includes/install.core.inc
Installation task; select which profile to install.
install_select_profile_form in includes/install.core.inc
Form API array definition for the profile selection form.
install_settings_form in includes/install.core.inc
Installation task; define a form to configure and rewrite settings.php.
install_tasks in includes/install.core.inc
Return a list of all tasks the installer currently knows about.
install_verify_requirements in includes/install.core.inc
Installation task; verify the requirements for installing Drupal.
mediamosa_profile_install in profiles/mediamosa_profile/mediamosa_profile.install
Implement hook_install().
standard_install in profiles/standard/standard.install
Implements hook_install().
theme_install_page in includes/theme.maintenance.inc
Generate a themed installation page.
_install_configure_form in includes/install.core.inc
Form API array definition for site configuration.
_install_module_batch in includes/install.core.inc
Batch callback for batch installation of modules.

Code

includes/install.inc, line 879

<?php
function st($string, $args = array()) {
  static $locale_strings = NULL;
  global $install_state;

  if (!isset($locale_strings)) {
    $locale_strings = array();
    if (isset($install_state['parameters']['profile']) && isset($install_state['parameters']['locale'])) {
      $filename = 'profiles/' . $install_state['parameters']['profile'] . '/translations/' . $install_state['parameters']['locale'] . '.po';
      if (file_exists(DRUPAL_ROOT . '/' . $filename)) {
        require_once DRUPAL_ROOT . '/includes/locale.inc';
        $file = (object) array('uri' => $filename);
        _locale_import_read_po('mem-store', $file);
        $locale_strings = _locale_import_one_string('mem-report');
      }
    }
  }

  require_once DRUPAL_ROOT . '/includes/theme.inc';
  // 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);
}
?>