diff --git b/core/includes/bootstrap.inc a/core/includes/bootstrap.inc index fc98b24..f1c1340 100644 --- b/core/includes/bootstrap.inc +++ a/core/includes/bootstrap.inc @@ -1499,8 +1499,7 @@ function bootstrap_hooks() { * (e.g., in Spanish, it might be "blog de @name"). * * During the Drupal installation phase, some resources used by t() wil not be - * available to code that needs localization. See st() and get_t() for - * alternatives. + * available to code that needs localization. See st() for alternatives. * * @param $string * A string containing the English string to translate. @@ -1519,7 +1518,6 @@ function bootstrap_hooks() { * The translated string. * * @see st() - * @see get_t() * @see format_string() * @ingroup sanitization */ @@ -2652,42 +2650,6 @@ function drupal_installation_attempted() { } /** - * 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: - * @code - * $t = get_t(); - * $translated = $t('translate this'); - * @endcode - * - * 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 t() - * @see st() - * @ingroup sanitization - */ -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; -} - -/** * Initializes all the defined language types. * * @see language() diff --git b/core/includes/form.inc a/core/includes/form.inc index b9180b2..d85cdc4 100644 --- b/core/includes/form.inc +++ a/core/includes/form.inc @@ -1340,9 +1340,6 @@ function drupal_redirect_form($form_state) { * theming, and hook_form_alter functions. */ function _form_validate(&$elements, &$form_state, $form_id = NULL) { - // Also used in the installer, pre-database setup. - $t = get_t(); - // Recurse through all children. foreach (element_children($elements) as $key) { if (isset($elements[$key]) && $elements[$key]) { @@ -1356,7 +1353,7 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) { if (isset($elements['#needs_validation'])) { // Verify that the value is not longer than #maxlength. if (isset($elements['#maxlength']) && drupal_strlen($elements['#value']) > $elements['#maxlength']) { - form_error($elements, $t('!name cannot be longer than %max characters but is currently %length characters long.', array('!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title'], '%max' => $elements['#maxlength'], '%length' => drupal_strlen($elements['#value'])))); + form_error($elements, t('!name cannot be longer than %max characters but is currently %length characters long.', array('!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title'], '%max' => $elements['#maxlength'], '%length' => drupal_strlen($elements['#value'])))); } if (isset($elements['#options']) && isset($elements['#value'])) { @@ -1370,7 +1367,7 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) { $value = in_array($elements['#type'], array('checkboxes', 'tableselect')) ? array_keys($elements['#value']) : $elements['#value']; foreach ($value as $v) { if (!isset($options[$v])) { - form_error($elements, $t('An illegal choice has been detected. Please contact the site administrator.')); + form_error($elements, t('An illegal choice has been detected. Please contact the site administrator.')); watchdog('form', 'Illegal choice %choice in !name element.', array('%choice' => $v, '!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']), WATCHDOG_ERROR); } } @@ -1389,7 +1386,7 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) { form_set_value($elements, NULL, $form_state); } elseif (!isset($options[$elements['#value']])) { - form_error($elements, $t('An illegal choice has been detected. Please contact the site administrator.')); + form_error($elements, t('An illegal choice has been detected. Please contact the site administrator.')); watchdog('form', 'Illegal choice %choice in %name element.', array('%choice' => $elements['#value'], '%name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']), WATCHDOG_ERROR); } } @@ -1472,7 +1469,7 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) { // constructors are encouraged to set #title anyway, and then set // #title_display to 'invisible'. This improves accessibility. elseif (isset($elements['#title'])) { - form_error($elements, $t('!name field is required.', array('!name' => $elements['#title']))); + form_error($elements, t('!name field is required.', array('!name' => $elements['#title']))); } else { form_error($elements); @@ -3169,13 +3166,12 @@ function theme_checkboxes($variables) { * This is used as a pre render function for checkboxes and radios. */ function form_pre_render_conditional_form_element($element) { - $t = get_t(); // Set the element's title attribute to show #title as a tooltip, if needed. if (isset($element['#title']) && $element['#title_display'] == 'attribute') { $element['#attributes']['title'] = $element['#title']; if (!empty($element['#required'])) { // Append an indication that this field is required. - $element['#attributes']['title'] .= ' (' . $t('Required') . ')'; + $element['#attributes']['title'] .= ' (' . t('Required') . ')'; } } @@ -4747,11 +4743,9 @@ function theme_form_element($variables) { * @ingroup themeable */ function theme_form_required_marker($variables) { - // This is also used in the installer, pre-database setup. - $t = get_t(); $attributes = array( 'class' => 'form-required', - 'title' => $t('This field is required.'), + 'title' => t('This field is required.'), ); return '*'; } @@ -4781,8 +4775,6 @@ function theme_form_required_marker($variables) { */ function theme_form_element_label($variables) { $element = $variables['element']; - // This is also used in the installer, pre-database setup. - $t = get_t(); // If title and required marker are both empty, output no label. if ((!isset($element['#title']) || $element['#title'] === '') && empty($element['#required'])) { @@ -4808,7 +4800,7 @@ function theme_form_element_label($variables) { $attributes['for'] = $element['#id']; } - return '' . $t('!title!required', array('!title' => $title, '!required' => $required)) . ''; + return '' . t('!title!required', array('!title' => $title, '!required' => $required)) . ''; } /** @@ -5017,8 +5009,6 @@ function batch_set($batch_definition) { } // Base and default properties for the batch set. - // Use get_t() to allow batches during installation. - $t = get_t(); $init = array( 'sandbox' => array(), 'results' => array(), @@ -5027,10 +5017,10 @@ function batch_set($batch_definition) { 'elapsed' => 0, ); $defaults = array( - 'title' => $t('Processing'), - 'init_message' => $t('Initializing.'), - 'progress_message' => $t('Completed @current of @total.'), - 'error_message' => $t('An error has occurred.'), + 'title' => t('Processing'), + 'init_message' => t('Initializing.'), + 'progress_message' => t('Completed @current of @total.'), + 'error_message' => t('An error has occurred.'), 'css' => array(), ); $batch_set = $init + $batch_definition + $defaults; @@ -5120,8 +5110,7 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = 'd if ($batch['progressive']) { // Now that we have a batch id, we can generate the redirection link in // the generic error message. - $t = get_t(); - $batch['error_message'] = $t('Please continue to the error page', array('@error_url' => url($url, array('query' => array('id' => $batch['id'], 'op' => 'finished'))))); + $batch['error_message'] = t('Please continue to the error page', array('@error_url' => url($url, array('query' => array('id' => $batch['id'], 'op' => 'finished'))))); // Clear the way for the drupal_goto() redirection to the batch processing // page, by saving and unsetting the 'destination', if there is any. diff --git b/core/includes/install.inc a/core/includes/install.inc index f6fc3d5..5a9cfaf 100644 --- b/core/includes/install.inc +++ a/core/includes/install.inc @@ -936,12 +936,11 @@ function drupal_requirements_url($severity) { * * 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. + * time. * * @todo Remove or keep as a t wrapper to mark config strings..? * * @see t() - * @see get_t() * @ingroup sanitization */ function st($string, array $args = array(), array $options = array()) { diff --git b/core/includes/standard.inc a/core/includes/standard.inc index 1289475..219ddff 100644 --- b/core/includes/standard.inc +++ a/core/includes/standard.inc @@ -21,259 +21,258 @@ function standard_country_list() { if (isset($countries)) { return $countries; } - $t = get_t(); $countries = array( - 'AD' => $t('Andorra'), - 'AE' => $t('United Arab Emirates'), - 'AF' => $t('Afghanistan'), - 'AG' => $t('Antigua and Barbuda'), - 'AI' => $t('Anguilla'), - 'AL' => $t('Albania'), - 'AM' => $t('Armenia'), - 'AN' => $t('Netherlands Antilles'), - 'AO' => $t('Angola'), - 'AQ' => $t('Antarctica'), - 'AR' => $t('Argentina'), - 'AS' => $t('American Samoa'), - 'AT' => $t('Austria'), - 'AU' => $t('Australia'), - 'AW' => $t('Aruba'), - 'AX' => $t('Åland Islands'), - 'AZ' => $t('Azerbaijan'), - 'BA' => $t('Bosnia and Herzegovina'), - 'BB' => $t('Barbados'), - 'BD' => $t('Bangladesh'), - 'BE' => $t('Belgium'), - 'BF' => $t('Burkina Faso'), - 'BG' => $t('Bulgaria'), - 'BH' => $t('Bahrain'), - 'BI' => $t('Burundi'), - 'BJ' => $t('Benin'), - 'BL' => $t('Saint Barthélemy'), - 'BM' => $t('Bermuda'), - 'BN' => $t('Brunei Darussalam'), - 'BO' => $t('Bolivia, Plurinational State of'), - 'BQ' => $t('Bonaire, Sint Eustatius and Saba'), - 'BR' => $t('Brazil'), - 'BS' => $t('Bahamas'), - 'BT' => $t('Bhutan'), - 'BV' => $t('Bouvet Island'), - 'BW' => $t('Botswana'), - 'BY' => $t('Belarus'), - 'BZ' => $t('Belize'), - 'CA' => $t('Canada'), - 'CC' => $t('Cocos (Keeling) Islands'), - 'CD' => $t('Congo, The Democratic Republic of the'), - 'CF' => $t('Central African Republic'), - 'CG' => $t('Congo'), - 'CH' => $t('Switzerland'), - 'CI' => $t("Côte d'Ivoire"), - 'CK' => $t('Cook Islands'), - 'CL' => $t('Chile'), - 'CM' => $t('Cameroon'), - 'CN' => $t('China'), - 'CO' => $t('Colombia'), - 'CR' => $t('Costa Rica'), - 'CU' => $t('Cuba'), - 'CV' => $t('Cape Verde'), - 'CW' => $t('Curaçao'), - 'CX' => $t('Christmas Island'), - 'CY' => $t('Cyprus'), - 'CZ' => $t('Czech Republic'), - 'DE' => $t('Germany'), - 'DJ' => $t('Djibouti'), - 'DK' => $t('Denmark'), - 'DM' => $t('Dominica'), - 'DO' => $t('Dominican Republic'), - 'DZ' => $t('Algeria'), - 'EC' => $t('Ecuador'), - 'EE' => $t('Estonia'), - 'EG' => $t('Egypt'), - 'EH' => $t('Western Sahara'), - 'ER' => $t('Eritrea'), - 'ES' => $t('Spain'), - 'ET' => $t('Ethiopia'), - 'FI' => $t('Finland'), - 'FJ' => $t('Fiji'), - 'FK' => $t('Falkland Islands (Malvinas)'), - 'FM' => $t('Micronesia, Federated States of'), - 'FO' => $t('Faroe Islands'), - 'FR' => $t('France'), - 'GA' => $t('Gabon'), - 'GB' => $t('United Kingdom'), - 'GD' => $t('Grenada'), - 'GE' => $t('Georgia'), - 'GF' => $t('French Guiana'), - 'GG' => $t('Guernsey'), - 'GH' => $t('Ghana'), - 'GI' => $t('Gibraltar'), - 'GL' => $t('Greenland'), - 'GM' => $t('Gambia'), - 'GN' => $t('Guinea'), - 'GP' => $t('Guadeloupe'), - 'GQ' => $t('Equatorial Guinea'), - 'GR' => $t('Greece'), - 'GS' => $t('South Georgia and the South Sandwich Islands'), - 'GT' => $t('Guatemala'), - 'GU' => $t('Guam'), - 'GW' => $t('Guinea-Bissau'), - 'GY' => $t('Guyana'), - 'HK' => $t('Hong Kong'), - 'HM' => $t('Heard Island and McDonald Islands'), - 'HN' => $t('Honduras'), - 'HR' => $t('Croatia'), - 'HT' => $t('Haiti'), - 'HU' => $t('Hungary'), - 'ID' => $t('Indonesia'), - 'IE' => $t('Ireland'), - 'IL' => $t('Israel'), - 'IM' => $t('Isle of Man'), - 'IN' => $t('India'), - 'IO' => $t('British Indian Ocean Territory'), - 'IQ' => $t('Iraq'), - 'IR' => $t('Iran, Islamic Republic of'), - 'IS' => $t('Iceland'), - 'IT' => $t('Italy'), - 'JE' => $t('Jersey'), - 'JM' => $t('Jamaica'), - 'JO' => $t('Jordan'), - 'JP' => $t('Japan'), - 'KE' => $t('Kenya'), - 'KG' => $t('Kyrgyzstan'), - 'KH' => $t('Cambodia'), - 'KI' => $t('Kiribati'), - 'KM' => $t('Comoros'), - 'KN' => $t('Saint Kitts and Nevis'), - 'KP' => $t("Korea, Democratic People's Republic of"), - 'KR' => $t('Korea, Republic of'), - 'KW' => $t('Kuwait'), - 'KY' => $t('Cayman Islands'), - 'KZ' => $t('Kazakhstan'), - 'LA' => $t("Lao People's Democratic Republic"), - 'LB' => $t('Lebanon'), - 'LC' => $t('Saint Lucia'), - 'LI' => $t('Liechtenstein'), - 'LK' => $t('Sri Lanka'), - 'LR' => $t('Liberia'), - 'LS' => $t('Lesotho'), - 'LT' => $t('Lithuania'), - 'LU' => $t('Luxembourg'), - 'LV' => $t('Latvia'), - 'LY' => $t('Libya'), - 'MA' => $t('Morocco'), - 'MC' => $t('Monaco'), - 'MD' => $t('Moldova, Republic of'), - 'ME' => $t('Montenegro'), - 'MF' => $t('Saint Martin (French part)'), - 'MG' => $t('Madagascar'), - 'MH' => $t('Marshall Islands'), - 'MK' => $t('Macedonia, Republic of'), - 'ML' => $t('Mali'), - 'MM' => $t('Myanmar'), - 'MN' => $t('Mongolia'), - 'MO' => $t('Macao'), - 'MP' => $t('Northern Mariana Islands'), - 'MQ' => $t('Martinique'), - 'MR' => $t('Mauritania'), - 'MS' => $t('Montserrat'), - 'MT' => $t('Malta'), - 'MU' => $t('Mauritius'), - 'MV' => $t('Maldives'), - 'MW' => $t('Malawi'), - 'MX' => $t('Mexico'), - 'MY' => $t('Malaysia'), - 'MZ' => $t('Mozambique'), - 'NA' => $t('Namibia'), - 'NC' => $t('New Caledonia'), - 'NE' => $t('Niger'), - 'NF' => $t('Norfolk Island'), - 'NG' => $t('Nigeria'), - 'NI' => $t('Nicaragua'), - 'NL' => $t('Netherlands'), - 'NO' => $t('Norway'), - 'NP' => $t('Nepal'), - 'NR' => $t('Nauru'), - 'NU' => $t('Niue'), - 'NZ' => $t('New Zealand'), - 'OM' => $t('Oman'), - 'PA' => $t('Panama'), - 'PE' => $t('Peru'), - 'PF' => $t('French Polynesia'), - 'PG' => $t('Papua New Guinea'), - 'PH' => $t('Philippines'), - 'PK' => $t('Pakistan'), - 'PL' => $t('Poland'), - 'PM' => $t('Saint Pierre and Miquelon'), - 'PN' => $t('Pitcairn'), - 'PR' => $t('Puerto Rico'), - 'PS' => $t('Palestine, State of'), - 'PT' => $t('Portugal'), - 'PW' => $t('Palau'), - 'PY' => $t('Paraguay'), - 'QA' => $t('Qatar'), - 'RE' => $t('Réunion'), - 'RO' => $t('Romania'), - 'RS' => $t('Serbia'), - 'RU' => $t('Russian Federation'), - 'RW' => $t('Rwanda'), - 'SA' => $t('Saudi Arabia'), - 'SB' => $t('Solomon Islands'), - 'SC' => $t('Seychelles'), - 'SD' => $t('Sudan'), - 'SE' => $t('Sweden'), - 'SG' => $t('Singapore'), - 'SH' => $t('Saint Helena, Ascension and Tristan da Cunha'), - 'SI' => $t('Slovenia'), - 'SJ' => $t('Svalbard and Jan Mayen'), - 'SK' => $t('Slovakia'), - 'SL' => $t('Sierra Leone'), - 'SM' => $t('San Marino'), - 'SN' => $t('Senegal'), - 'SO' => $t('Somalia'), - 'SR' => $t('Suriname'), - 'SS' => $t('South Sudan'), - 'ST' => $t('Sao Tome and Principe'), - 'SV' => $t('El Salvador'), - 'SX' => $t('Sint Maarten (Dutch part)'), - 'SY' => $t('Syrian Arab Republic'), - 'SZ' => $t('Swaziland'), - 'TC' => $t('Turks and Caicos Islands'), - 'TD' => $t('Chad'), - 'TF' => $t('French Southern Territories'), - 'TG' => $t('Togo'), - 'TH' => $t('Thailand'), - 'TJ' => $t('Tajikistan'), - 'TK' => $t('Tokelau'), - 'TL' => $t('Timor-Leste'), - 'TM' => $t('Turkmenistan'), - 'TN' => $t('Tunisia'), - 'TO' => $t('Tonga'), - 'TR' => $t('Turkey'), - 'TT' => $t('Trinidad and Tobago'), - 'TV' => $t('Tuvalu'), - 'TW' => $t('Taiwan, Province of China'), - 'TZ' => $t('Tanzania, United Republic of'), - 'UA' => $t('Ukraine'), - 'UG' => $t('Uganda'), - 'UM' => $t('United States Minor Outlying Islands'), - 'US' => $t('United States'), - 'UY' => $t('Uruguay'), - 'UZ' => $t('Uzbekistan'), - 'VA' => $t('Holy See (Vatican City State)'), - 'VC' => $t('Saint Vincent and the Grenadines'), - 'VE' => $t('Venezuela, Bolivarian Republic of'), - 'VG' => $t('Virgin Islands, British'), - 'VI' => $t('Virgin Islands, U.S.'), - 'VN' => $t('Viet Nam'), - 'VU' => $t('Vanuatu'), - 'WF' => $t('Wallis and Futuna'), - 'WS' => $t('Samoa'), - 'YE' => $t('Yemen'), - 'YT' => $t('Mayotte'), - 'ZA' => $t('South Africa'), - 'ZM' => $t('Zambia'), - 'ZW' => $t('Zimbabwe'), + 'AD' => t('Andorra'), + 'AE' => t('United Arab Emirates'), + 'AF' => t('Afghanistan'), + 'AG' => t('Antigua and Barbuda'), + 'AI' => t('Anguilla'), + 'AL' => t('Albania'), + 'AM' => t('Armenia'), + 'AN' => t('Netherlands Antilles'), + 'AO' => t('Angola'), + 'AQ' => t('Antarctica'), + 'AR' => t('Argentina'), + 'AS' => t('American Samoa'), + 'AT' => t('Austria'), + 'AU' => t('Australia'), + 'AW' => t('Aruba'), + 'AX' => t('Åland Islands'), + 'AZ' => t('Azerbaijan'), + 'BA' => t('Bosnia and Herzegovina'), + 'BB' => t('Barbados'), + 'BD' => t('Bangladesh'), + 'BE' => t('Belgium'), + 'BF' => t('Burkina Faso'), + 'BG' => t('Bulgaria'), + 'BH' => t('Bahrain'), + 'BI' => t('Burundi'), + 'BJ' => t('Benin'), + 'BL' => t('Saint Barthélemy'), + 'BM' => t('Bermuda'), + 'BN' => t('Brunei Darussalam'), + 'BO' => t('Bolivia, Plurinational State of'), + 'BQ' => t('Bonaire, Sint Eustatius and Saba'), + 'BR' => t('Brazil'), + 'BS' => t('Bahamas'), + 'BT' => t('Bhutan'), + 'BV' => t('Bouvet Island'), + 'BW' => t('Botswana'), + 'BY' => t('Belarus'), + 'BZ' => t('Belize'), + 'CA' => t('Canada'), + 'CC' => t('Cocos (Keeling) Islands'), + 'CD' => t('Congo, The Democratic Republic of the'), + 'CF' => t('Central African Republic'), + 'CG' => t('Congo'), + 'CH' => t('Switzerland'), + 'CI' => t("Côte d'Ivoire"), + 'CK' => t('Cook Islands'), + 'CL' => t('Chile'), + 'CM' => t('Cameroon'), + 'CN' => t('China'), + 'CO' => t('Colombia'), + 'CR' => t('Costa Rica'), + 'CU' => t('Cuba'), + 'CV' => t('Cape Verde'), + 'CW' => t('Curaçao'), + 'CX' => t('Christmas Island'), + 'CY' => t('Cyprus'), + 'CZ' => t('Czech Republic'), + 'DE' => t('Germany'), + 'DJ' => t('Djibouti'), + 'DK' => t('Denmark'), + 'DM' => t('Dominica'), + 'DO' => t('Dominican Republic'), + 'DZ' => t('Algeria'), + 'EC' => t('Ecuador'), + 'EE' => t('Estonia'), + 'EG' => t('Egypt'), + 'EH' => t('Western Sahara'), + 'ER' => t('Eritrea'), + 'ES' => t('Spain'), + 'ET' => t('Ethiopia'), + 'FI' => t('Finland'), + 'FJ' => t('Fiji'), + 'FK' => t('Falkland Islands (Malvinas)'), + 'FM' => t('Micronesia, Federated States of'), + 'FO' => t('Faroe Islands'), + 'FR' => t('France'), + 'GA' => t('Gabon'), + 'GB' => t('United Kingdom'), + 'GD' => t('Grenada'), + 'GE' => t('Georgia'), + 'GF' => t('French Guiana'), + 'GG' => t('Guernsey'), + 'GH' => t('Ghana'), + 'GI' => t('Gibraltar'), + 'GL' => t('Greenland'), + 'GM' => t('Gambia'), + 'GN' => t('Guinea'), + 'GP' => t('Guadeloupe'), + 'GQ' => t('Equatorial Guinea'), + 'GR' => t('Greece'), + 'GS' => t('South Georgia and the South Sandwich Islands'), + 'GT' => t('Guatemala'), + 'GU' => t('Guam'), + 'GW' => t('Guinea-Bissau'), + 'GY' => t('Guyana'), + 'HK' => t('Hong Kong'), + 'HM' => t('Heard Island and McDonald Islands'), + 'HN' => t('Honduras'), + 'HR' => t('Croatia'), + 'HT' => t('Haiti'), + 'HU' => t('Hungary'), + 'ID' => t('Indonesia'), + 'IE' => t('Ireland'), + 'IL' => t('Israel'), + 'IM' => t('Isle of Man'), + 'IN' => t('India'), + 'IO' => t('British Indian Ocean Territory'), + 'IQ' => t('Iraq'), + 'IR' => t('Iran, Islamic Republic of'), + 'IS' => t('Iceland'), + 'IT' => t('Italy'), + 'JE' => t('Jersey'), + 'JM' => t('Jamaica'), + 'JO' => t('Jordan'), + 'JP' => t('Japan'), + 'KE' => t('Kenya'), + 'KG' => t('Kyrgyzstan'), + 'KH' => t('Cambodia'), + 'KI' => t('Kiribati'), + 'KM' => t('Comoros'), + 'KN' => t('Saint Kitts and Nevis'), + 'KP' => t("Korea, Democratic People's Republic of"), + 'KR' => t('Korea, Republic of'), + 'KW' => t('Kuwait'), + 'KY' => t('Cayman Islands'), + 'KZ' => t('Kazakhstan'), + 'LA' => t("Lao People's Democratic Republic"), + 'LB' => t('Lebanon'), + 'LC' => t('Saint Lucia'), + 'LI' => t('Liechtenstein'), + 'LK' => t('Sri Lanka'), + 'LR' => t('Liberia'), + 'LS' => t('Lesotho'), + 'LT' => t('Lithuania'), + 'LU' => t('Luxembourg'), + 'LV' => t('Latvia'), + 'LY' => t('Libya'), + 'MA' => t('Morocco'), + 'MC' => t('Monaco'), + 'MD' => t('Moldova, Republic of'), + 'ME' => t('Montenegro'), + 'MF' => t('Saint Martin (French part)'), + 'MG' => t('Madagascar'), + 'MH' => t('Marshall Islands'), + 'MK' => t('Macedonia, Republic of'), + 'ML' => t('Mali'), + 'MM' => t('Myanmar'), + 'MN' => t('Mongolia'), + 'MO' => t('Macao'), + 'MP' => t('Northern Mariana Islands'), + 'MQ' => t('Martinique'), + 'MR' => t('Mauritania'), + 'MS' => t('Montserrat'), + 'MT' => t('Malta'), + 'MU' => t('Mauritius'), + 'MV' => t('Maldives'), + 'MW' => t('Malawi'), + 'MX' => t('Mexico'), + 'MY' => t('Malaysia'), + 'MZ' => t('Mozambique'), + 'NA' => t('Namibia'), + 'NC' => t('New Caledonia'), + 'NE' => t('Niger'), + 'NF' => t('Norfolk Island'), + 'NG' => t('Nigeria'), + 'NI' => t('Nicaragua'), + 'NL' => t('Netherlands'), + 'NO' => t('Norway'), + 'NP' => t('Nepal'), + 'NR' => t('Nauru'), + 'NU' => t('Niue'), + 'NZ' => t('New Zealand'), + 'OM' => t('Oman'), + 'PA' => t('Panama'), + 'PE' => t('Peru'), + 'PF' => t('French Polynesia'), + 'PG' => t('Papua New Guinea'), + 'PH' => t('Philippines'), + 'PK' => t('Pakistan'), + 'PL' => t('Poland'), + 'PM' => t('Saint Pierre and Miquelon'), + 'PN' => t('Pitcairn'), + 'PR' => t('Puerto Rico'), + 'PS' => t('Palestine, State of'), + 'PT' => t('Portugal'), + 'PW' => t('Palau'), + 'PY' => t('Paraguay'), + 'QA' => t('Qatar'), + 'RE' => t('Réunion'), + 'RO' => t('Romania'), + 'RS' => t('Serbia'), + 'RU' => t('Russian Federation'), + 'RW' => t('Rwanda'), + 'SA' => t('Saudi Arabia'), + 'SB' => t('Solomon Islands'), + 'SC' => t('Seychelles'), + 'SD' => t('Sudan'), + 'SE' => t('Sweden'), + 'SG' => t('Singapore'), + 'SH' => t('Saint Helena, Ascension and Tristan da Cunha'), + 'SI' => t('Slovenia'), + 'SJ' => t('Svalbard and Jan Mayen'), + 'SK' => t('Slovakia'), + 'SL' => t('Sierra Leone'), + 'SM' => t('San Marino'), + 'SN' => t('Senegal'), + 'SO' => t('Somalia'), + 'SR' => t('Suriname'), + 'SS' => t('South Sudan'), + 'ST' => t('Sao Tome and Principe'), + 'SV' => t('El Salvador'), + 'SX' => t('Sint Maarten (Dutch part)'), + 'SY' => t('Syrian Arab Republic'), + 'SZ' => t('Swaziland'), + 'TC' => t('Turks and Caicos Islands'), + 'TD' => t('Chad'), + 'TF' => t('French Southern Territories'), + 'TG' => t('Togo'), + 'TH' => t('Thailand'), + 'TJ' => t('Tajikistan'), + 'TK' => t('Tokelau'), + 'TL' => t('Timor-Leste'), + 'TM' => t('Turkmenistan'), + 'TN' => t('Tunisia'), + 'TO' => t('Tonga'), + 'TR' => t('Turkey'), + 'TT' => t('Trinidad and Tobago'), + 'TV' => t('Tuvalu'), + 'TW' => t('Taiwan, Province of China'), + 'TZ' => t('Tanzania, United Republic of'), + 'UA' => t('Ukraine'), + 'UG' => t('Uganda'), + 'UM' => t('United States Minor Outlying Islands'), + 'US' => t('United States'), + 'UY' => t('Uruguay'), + 'UZ' => t('Uzbekistan'), + 'VA' => t('Holy See (Vatican City State)'), + 'VC' => t('Saint Vincent and the Grenadines'), + 'VE' => t('Venezuela, Bolivarian Republic of'), + 'VG' => t('Virgin Islands, British'), + 'VI' => t('Virgin Islands, U.S.'), + 'VN' => t('Viet Nam'), + 'VU' => t('Vanuatu'), + 'WF' => t('Wallis and Futuna'), + 'WS' => t('Samoa'), + 'YE' => t('Yemen'), + 'YT' => t('Mayotte'), + 'ZA' => t('South Africa'), + 'ZM' => t('Zambia'), + 'ZW' => t('Zimbabwe'), ); // Sort the list. diff --git b/core/includes/theme.maintenance.inc a/core/includes/theme.maintenance.inc index 578d354..6d691af 100644 --- b/core/includes/theme.maintenance.inc +++ a/core/includes/theme.maintenance.inc @@ -117,7 +117,6 @@ function _theme_load_offline_registry($theme, $base_theme = NULL, $theme_engine * @ingroup themeable */ function theme_task_list($variables) { - $t = get_t(); $items = $variables['items']; $active = $variables['active']; @@ -128,12 +127,12 @@ function theme_task_list($variables) { foreach ($items as $k => $item) { if ($active == $k) { $class = 'active'; - $status = '(' . $t('active') . ')'; + $status = '(' . t('active') . ')'; $done = FALSE; } else { $class = $done ? 'done' : ''; - $status = $done ? '(' . $t('done') . ')' : ''; + $status = $done ? '(' . t('done') . ')' : ''; } $output .= ''; diff --git b/core/includes/unicode.inc a/core/includes/unicode.inc index 70a8fde..e1fd34e 100644 --- b/core/includes/unicode.inc +++ a/core/includes/unicode.inc @@ -70,13 +70,10 @@ * Returns Unicode library status and errors. */ function unicode_requirements() { - // Ensure translations don't break during installation. - $t = get_t(); - $libraries = array( - UNICODE_SINGLEBYTE => $t('Standard PHP'), - UNICODE_MULTIBYTE => $t('PHP Mbstring Extension'), - UNICODE_ERROR => $t('Error'), + UNICODE_SINGLEBYTE => t('Standard PHP'), + UNICODE_MULTIBYTE => t('PHP Mbstring Extension'), + UNICODE_ERROR => t('Error'), ); $severities = array( UNICODE_SINGLEBYTE => REQUIREMENT_WARNING, @@ -87,30 +84,30 @@ function unicode_requirements() { $library = $GLOBALS['multibyte']; $requirements['unicode'] = array( - 'title' => $t('Unicode library'), + 'title' => t('Unicode library'), 'value' => $libraries[$library], 'severity' => $severities[$library], ); $t_args = array('@url' => 'http://www.php.net/mbstring'); switch ($failed_check) { case 'mb_strlen': - $requirements['unicode']['description'] = $t('Operations on Unicode strings are emulated on a best-effort basis. Install the PHP mbstring extension for improved Unicode support.', $t_args); + $requirements['unicode']['description'] = t('Operations on Unicode strings are emulated on a best-effort basis. Install the PHP mbstring extension for improved Unicode support.', $t_args); break; case 'mbstring.func_overload': - $requirements['unicode']['description'] = $t('Multibyte string function overloading in PHP is active and must be disabled. Check the php.ini mbstring.func_overload setting. Please refer to the PHP mbstring documentation for more information.', $t_args); + $requirements['unicode']['description'] = t('Multibyte string function overloading in PHP is active and must be disabled. Check the php.ini mbstring.func_overload setting. Please refer to the PHP mbstring documentation for more information.', $t_args); break; case 'mbstring.encoding_translation': - $requirements['unicode']['description'] = $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.encoding_translation setting. Please refer to the PHP mbstring documentation for more information.', $t_args); + $requirements['unicode']['description'] = t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.encoding_translation setting. Please refer to the PHP mbstring documentation for more information.', $t_args); break; case 'mbstring.http_input': - $requirements['unicode']['description'] = $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_input setting. Please refer to the PHP mbstring documentation for more information.', $t_args); + $requirements['unicode']['description'] = t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_input setting. Please refer to the PHP mbstring documentation for more information.', $t_args); break; case 'mbstring.http_output': - $requirements['unicode']['description'] = $t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_output setting. Please refer to the PHP mbstring documentation for more information.', $t_args); + $requirements['unicode']['description'] = t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_output setting. Please refer to the PHP mbstring documentation for more information.', $t_args); break; } diff --git b/core/lib/Drupal/Component/Gettext/PoStreamReader.php a/core/lib/Drupal/Component/Gettext/PoStreamReader.php index d0060a6..e3ac4b8 100644 --- b/core/lib/Drupal/Component/Gettext/PoStreamReader.php +++ a/core/lib/Drupal/Component/Gettext/PoStreamReader.php @@ -258,7 +258,6 @@ private function readHeader() { * for later presentation. */ private function readLine() { - $t = get_t(); // Read a line and set the stream finished indicator if it was not // possible anymore. $line = fgets($this->_fd); @@ -306,7 +305,7 @@ private function readLine() { } else { // A comment following any other context is a syntax error. - $this->_errors[] = $t('The translation stream %uri contains an error: "msgstr" was expected but not found on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: "msgstr" was expected but not found on line %line.', $log_vars); return FALSE; } return; @@ -316,7 +315,7 @@ private function readLine() { if ($this->_context != 'MSGID') { // A plural form can only be added to an msgid directly. - $this->_errors[] = $t('The translation stream %uri contains an error: "msgid_plural" was expected but not found on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: "msgid_plural" was expected but not found on line %line.', $log_vars); return FALSE; } @@ -327,7 +326,7 @@ private function readLine() { $quoted = $this->parseQuoted($line); if ($quoted === FALSE) { // The plural form must be wrapped in quotes. - $this->_errors[] = $t('The translation stream %uri contains a syntax error on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains a syntax error on line %line.', $log_vars); return FALSE; } @@ -354,7 +353,7 @@ private function readLine() { } elseif ($this->_context == 'MSGID') { // We are currently already in the context, meaning we passed an id with no data. - $this->_errors[] = $t('The translation stream %uri contains an error: "msgid" is unexpected on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: "msgid" is unexpected on line %line.', $log_vars); return FALSE; } @@ -365,7 +364,7 @@ private function readLine() { $quoted = $this->parseQuoted($line); if ($quoted === FALSE) { // The message id must be wrapped in quotes. - $this->_errors[] = $t('The translation stream %uri contains an error: invalid format for "msgid" on line %line.', $log_vars, $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: invalid format for "msgid" on line %line.', $log_vars, $log_vars); return FALSE; } @@ -383,7 +382,7 @@ private function readLine() { } elseif (!empty($this->_current_item['msgctxt'])) { // A context cannot apply to another context. - $this->_errors[] = $t('The translation stream %uri contains an error: "msgctxt" is unexpected on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: "msgctxt" is unexpected on line %line.', $log_vars); return FALSE; } @@ -394,7 +393,7 @@ private function readLine() { $quoted = $this->parseQuoted($line); if ($quoted === FALSE) { // The context string must be quoted. - $this->_errors[] = $t('The translation stream %uri contains an error: invalid format for "msgctxt" on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: invalid format for "msgctxt" on line %line.', $log_vars); return FALSE; } @@ -412,13 +411,13 @@ private function readLine() { ($this->_context != 'MSGSTR_ARR')) { // Plural message strings must come after msgid, msgxtxt, // msgid_plural, or other msgstr[] entries. - $this->_errors[] = $t('The translation stream %uri contains an error: "msgstr[]" is unexpected on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: "msgstr[]" is unexpected on line %line.', $log_vars); return FALSE; } // Ensure the plurality is terminated. if (strpos($line, ']') === FALSE) { - $this->_errors[] = $t('The translation stream %uri contains an error: invalid format for "msgstr[]" on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: invalid format for "msgstr[]" on line %line.', $log_vars); return FALSE; } @@ -433,7 +432,7 @@ private function readLine() { $quoted = $this->parseQuoted($line); if ($quoted === FALSE) { // The string must be quoted. - $this->_errors[] = $t('The translation stream %uri contains an error: invalid format for "msgstr[]" on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: invalid format for "msgstr[]" on line %line.', $log_vars); return FALSE; } if (!isset($this->_current_item['msgstr']) || !is_array($this->_current_item['msgstr'])) { @@ -450,7 +449,7 @@ private function readLine() { if (($this->_context != 'MSGID') && ($this->_context != 'MSGCTXT')) { // Strings are only valid within an id or context scope. - $this->_errors[] = $t('The translation stream %uri contains an error: "msgstr" is unexpected on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: "msgstr" is unexpected on line %line.', $log_vars); return FALSE; } @@ -461,7 +460,7 @@ private function readLine() { $quoted = $this->parseQuoted($line); if ($quoted === FALSE) { // The string must be quoted. - $this->_errors[] = $t('The translation stream %uri contains an error: invalid format for "msgstr" on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: invalid format for "msgstr" on line %line.', $log_vars); return FALSE; } @@ -476,7 +475,7 @@ private function readLine() { $quoted = $this->parseQuoted($line); if ($quoted === FALSE) { // This string must be quoted. - $this->_errors[] = $t('The translation stream %uri contains an error: string continuation expected on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: string continuation expected on line %line.', $log_vars); return FALSE; } @@ -506,7 +505,7 @@ private function readLine() { } else { // No valid context to append to. - $this->_errors[] = $t('The translation stream %uri contains an error: unexpected string on line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri contains an error: unexpected string on line %line.', $log_vars); return FALSE; } return; @@ -519,7 +518,7 @@ private function readLine() { $this->_current_item = array(); } elseif ($this->_context != 'COMMENT') { - $this->_errors[] = $t('The translation stream %uri ended unexpectedly at line %line.', $log_vars); + $this->_errors[] = t('The translation stream %uri ended unexpectedly at line %line.', $log_vars); return FALSE; } } diff --git b/core/lib/Drupal/Core/Translation/FileTranslation.php a/core/lib/Drupal/Core/Translation/FileTranslation.php index 255e068..129ec33 100644 --- b/core/lib/Drupal/Core/Translation/FileTranslation.php +++ a/core/lib/Drupal/Core/Translation/FileTranslation.php @@ -19,8 +19,7 @@ * system is possibly not yet available. * * 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. + * Use st() if your code will only run during installation. */ class FileTranslation extends StaticTranslation { diff --git b/core/modules/aggregator/aggregator.install a/core/modules/aggregator/aggregator.install index 11447ee..e7ddfc3 100644 --- b/core/modules/aggregator/aggregator.install +++ a/core/modules/aggregator/aggregator.install @@ -9,16 +9,15 @@ * Implements hook_requirements(). */ function aggregator_requirements($phase) { - $t = get_t(); $has_curl = function_exists('curl_init'); $requirements = array(); $requirements['curl'] = array( - 'title' => $t('cURL'), - 'value' => $has_curl ? $t('Enabled') : $t('Not found'), + 'title' => t('cURL'), + 'value' => $has_curl ? t('Enabled') : t('Not found'), ); if (!$has_curl) { $requirements['curl']['severity'] = REQUIREMENT_ERROR; - $requirements['curl']['description'] = $t('The Aggregator module could not be installed because the PHP cURL library is not available.', array('@curl_url' => 'http://php.net/manual/curl.setup.php')); + $requirements['curl']['description'] = t('The Aggregator module could not be installed because the PHP cURL library is not available.', array('@curl_url' => 'http://php.net/manual/curl.setup.php')); } return $requirements; } diff --git b/core/modules/field/field.install a/core/modules/field/field.install index 663ae69..d17543a 100644 --- b/core/modules/field/field.install +++ a/core/modules/field/field.install @@ -108,8 +108,7 @@ function _update_7000_field_create_field(&$field) { function _update_7000_field_delete_field($field_name) { $table_name = 'field_data_' . $field_name; if (db_select($table_name)->range(0, 1)->countQuery()->execute()->fetchField()) { - $t = get_t(); - throw new Exception($t('This function can only be used to delete fields without data')); + throw new Exception(t('This function can only be used to delete fields without data')); } // Delete all instances. db_delete('field_config_instance') diff --git b/core/modules/locale/lib/Drupal/locale/LocaleTranslation.php a/core/modules/locale/lib/Drupal/locale/LocaleTranslation.php index 62c772c..1001e35 100644 --- b/core/modules/locale/lib/Drupal/locale/LocaleTranslation.php +++ a/core/modules/locale/lib/Drupal/locale/LocaleTranslation.php @@ -11,7 +11,6 @@ use Drupal\locale\StringStorageInterface; use Drupal\locale\LocaleLookup; - /** * String translator using the locale module. * diff --git b/core/modules/locale/locale.batch.inc a/core/modules/locale/locale.batch.inc index 39bc966..4dc1725 100644 --- b/core/modules/locale/locale.batch.inc +++ a/core/modules/locale/locale.batch.inc @@ -32,7 +32,6 @@ * @see locale_translation_batch_status_compare() */ function locale_translation_batch_status_fetch_remote($source, &$context) { - $t = get_t(); // Check the translation file at the remote server and update the source // data with the remote status. if (isset($source->files[LOCALE_TRANSLATION_REMOTE])) { @@ -57,7 +56,7 @@ function locale_translation_batch_status_fetch_remote($source, &$context) { $context['results']['failed_files'][] = $source->name; } $context['results']['sources'][$source->name][$source->langcode] = $source; - $context['message'] = $t('Checked translation for %project.', array('%project' => $source->project)); + $context['message'] = t('Checked translation for %project.', array('%project' => $source->project)); } } @@ -78,7 +77,6 @@ function locale_translation_batch_status_fetch_remote($source, &$context) { * @see locale_translation_batch_status_compare() */ function locale_translation_batch_status_fetch_local($sources, &$context) { - $t = get_t(); // Get the status of local translation files and store the result data in the // batch results for later processing. foreach ($sources as $source) { @@ -96,7 +94,7 @@ function locale_translation_batch_status_fetch_local($sources, &$context) { $context['results']['sources'][$source->name][$source->langcode] = $source; } } - $context['message'] = $t('Checked all translations.'); + $context['message'] = t('Checked all translations.'); } /** @@ -116,7 +114,6 @@ function locale_translation_batch_status_fetch_local($sources, &$context) { * @see locale_translation_batch_status_fetch_local() */ function locale_translation_batch_status_compare(&$context) { - $t = get_t(); $history = locale_translation_get_file_history(); $results = array(); @@ -159,7 +156,7 @@ function locale_translation_batch_status_compare(&$context) { $results[$project][$langcode] = $source; } } - $context['message'] = $t('Updated translation status.'); + $context['message'] = t('Updated translation status.'); } locale_translation_status_save($results); } @@ -173,7 +170,6 @@ function locale_translation_batch_status_compare(&$context) { * Batch results. */ function locale_translation_batch_status_finished($success, $results) { - $t = get_t(); if ($success) { if (isset($results['failed_files'])) { if (module_exists('dblog')) { @@ -196,7 +192,7 @@ function locale_translation_batch_status_finished($success, $results) { } } else { - drupal_set_message($t('An error occurred trying to check available interface translation updates.'), 'error'); + drupal_set_message(t('An error occurred trying to check available interface translation updates.'), 'error'); } } @@ -250,9 +246,8 @@ function locale_translation_batch_fetch_download($project, $langcode, &$context) if (isset($sources[$project . ':' . $langcode])) { $source = $sources[$project . ':' . $langcode]; if (isset($source->type) && $source->type == LOCALE_TRANSLATION_REMOTE) { - $t = get_t(); if ($file = locale_translation_download_source($source->files[LOCALE_TRANSLATION_REMOTE])) { - $context['message'] = $t('Downloaded translation for %project.', array('%project' => $source->project)); + $context['message'] = t('Downloaded translation for %project.', array('%project' => $source->project)); $source->files[LOCALE_TRANSLATION_DOWNLOADED] = $file; } else { @@ -294,8 +289,6 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$ $source = $sources[$project . ':' . $langcode]; if (isset($source->type)) { if ($source->type == LOCALE_TRANSLATION_REMOTE || $source->type == LOCALE_TRANSLATION_LOCAL) { - - $t = get_t(); // If we are working on a remote file we will import the downloaded // file. If the file was local just mark the result as such. if ($source->type == LOCALE_TRANSLATION_REMOTE) { @@ -312,7 +305,7 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$ $file = $source_result->files[$import_type]; module_load_include('bulk.inc', 'locale'); $options += array( - 'message' => $t('Importing translation for %project.', array('%project' => $source->project)), + 'message' => t('Importing translation for %project.', array('%project' => $source->project)), ); // Import the translation file. For large files the batch operations is // progressive and will be called repeatedly untill finished. @@ -322,7 +315,7 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$ if (isset($context['finished']) && $context['finished'] == 1) { // The import is successfull. if (isset($context['results']['files'][$file->uri])) { - $context['message'] = $t('Imported translation for %project.', array('%project' => $source->project)); + $context['message'] = t('Imported translation for %project.', array('%project' => $source->project)); // Keep the data of imported source. In the following batch // operation it will be saved in the {locale_file} table. @@ -386,7 +379,6 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$ * @see locale_translation_batch_status_compare() */ function locale_translation_batch_fetch_update_status(&$context) { - $t = get_t(); $results = array(); if (isset($context['results']['sources'])) { @@ -411,7 +403,7 @@ function locale_translation_batch_fetch_update_status(&$context) { $context['results']['sources'][$project][$langcode] = $source; } } - $context['message'] = $t('Updated translations.'); + $context['message'] = t('Updated translations.'); // The file history has changed, flush the static cache now. drupal_static_reset('locale_translation_get_file_history'); diff --git b/core/modules/locale/locale.bulk.inc a/core/modules/locale/locale.bulk.inc index 49273d8..1ab4d5d 100644 --- b/core/modules/locale/locale.bulk.inc +++ a/core/modules/locale/locale.bulk.inc @@ -390,7 +390,6 @@ function locale_translate_batch_build($files, $options) { 'customized' => LOCALE_NOT_CUSTOMIZED, 'finish_feedback' => TRUE, ); - $t = get_t(); if (count($files)) { $operations = array(); foreach ($files as $file) { @@ -402,9 +401,9 @@ function locale_translate_batch_build($files, $options) { $batch = array( 'operations' => $operations, - 'title' => $t('Importing interface translations'), + 'title' => t('Importing interface translations'), 'progress_message' => '', - 'error_message' => $t('Error importing interface translations'), + 'error_message' => t('Error importing interface translations'), 'file' => drupal_get_path('module', 'locale') . '/locale.bulk.inc', ); if ($options['finish_feedback']) { diff --git b/core/modules/locale/locale.compare.inc a/core/modules/locale/locale.compare.inc index 9eba52e..c4c843f 100644 --- b/core/modules/locale/locale.compare.inc +++ a/core/modules/locale/locale.compare.inc @@ -297,7 +297,6 @@ function locale_translation_check_projects_batch($projects = array(), $langcodes * Batch definition array. */ function locale_translation_batch_status_build($projects = array(), $langcodes = array()) { - $t = get_t(); $projects = $projects ? $projects : array_keys(locale_translation_get_projects()); $langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list()); @@ -305,10 +304,10 @@ function locale_translation_batch_status_build($projects = array(), $langcodes = $batch = array( 'operations' => $operations, - 'title' => $t('Checking translations'), + 'title' => t('Checking translations'), 'progress_message' => '', 'finished' => 'locale_translation_batch_status_finished', - 'error_message' => $t('Error checking translation updates.'), + 'error_message' => t('Error checking translation updates.'), 'file' => drupal_get_path('module', 'locale') . '/locale.batch.inc', ); return $batch; diff --git b/core/modules/locale/locale.fetch.inc a/core/modules/locale/locale.fetch.inc index d509b69..e35cab6 100644 --- b/core/modules/locale/locale.fetch.inc +++ a/core/modules/locale/locale.fetch.inc @@ -28,7 +28,6 @@ */ function locale_translation_batch_update_build($projects = array(), $langcodes = array(), $options = array()) { module_load_include('compare.inc', 'locale'); - $t = get_t(); $projects = $projects ? $projects : array_keys(locale_translation_get_projects()); $langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list()); @@ -37,9 +36,9 @@ function locale_translation_batch_update_build($projects = array(), $langcodes = $batch = array( 'operations' => $operations, - 'title' => $t('Updating translations'), + 'title' => t('Updating translations'), 'progress_message' => '', - 'error_message' => $t('Error importing translation files'), + 'error_message' => t('Error importing translation files'), 'finished' => 'locale_translation_batch_fetch_finished', 'file' => drupal_get_path('module', 'locale') . '/locale.batch.inc', ); @@ -64,12 +63,11 @@ function locale_translation_batch_fetch_build($projects = array(), $langcodes = $projects = $projects ? $projects : array_keys(locale_translation_get_projects()); $langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list()); - $t = get_t(); $batch = array( 'operations' => _locale_translation_fetch_operations($projects, $langcodes, $options), - 'title' => $t('Updating translations.'), + 'title' => t('Updating translations.'), 'progress_message' => '', - 'error_message' => $t('Error importing translation files'), + 'error_message' => t('Error importing translation files'), 'finished' => 'locale_translation_batch_fetch_finished', 'file' => drupal_get_path('module', 'locale') . '/locale.batch.inc', ); diff --git b/core/modules/simpletest/simpletest.install a/core/modules/simpletest/simpletest.install index 387d88c..020b3cd 100644 --- b/core/modules/simpletest/simpletest.install +++ a/core/modules/simpletest/simpletest.install @@ -15,7 +15,6 @@ */ function simpletest_requirements($phase) { $requirements = array(); - $t = get_t(); $has_curl = function_exists('curl_init'); $has_hash = function_exists('hash_hmac'); @@ -23,41 +22,41 @@ function simpletest_requirements($phase) { $open_basedir = ini_get('open_basedir'); $requirements['curl'] = array( - 'title' => $t('cURL'), - 'value' => $has_curl ? $t('Enabled') : $t('Not found'), + 'title' => t('cURL'), + 'value' => $has_curl ? t('Enabled') : t('Not found'), ); if (!$has_curl) { $requirements['curl']['severity'] = REQUIREMENT_ERROR; - $requirements['curl']['description'] = $t('The testing framework could not be installed because the PHP cURL library is not available.', array('@curl_url' => 'http://php.net/manual/curl.setup.php')); + $requirements['curl']['description'] = t('The testing framework could not be installed because the PHP cURL library is not available.', array('@curl_url' => 'http://php.net/manual/curl.setup.php')); } $requirements['hash'] = array( - 'title' => $t('hash'), - 'value' => $has_hash ? $t('Enabled') : $t('Not found'), + 'title' => t('hash'), + 'value' => $has_hash ? t('Enabled') : t('Not found'), ); if (!$has_hash) { $requirements['hash']['severity'] = REQUIREMENT_ERROR; - $requirements['hash']['description'] = $t('The testing framework could not be installed because the PHP hash extension is disabled.', array('@hash_url' => 'http://php.net/manual/book.hash.php')); + $requirements['hash']['description'] = t('The testing framework could not be installed because the PHP hash extension is disabled.', array('@hash_url' => 'http://php.net/manual/book.hash.php')); } $requirements['php_domdocument'] = array( - 'title' => $t('PHP DOMDocument class'), - 'value' => $has_domdocument ? $t('Enabled') : $t('Not found'), + 'title' => t('PHP DOMDocument class'), + 'value' => $has_domdocument ? t('Enabled') : t('Not found'), ); if (!$has_domdocument) { $requirements['php_domdocument']['severity'] = REQUIREMENT_ERROR; - $requirements['php_domdocument']['description'] = $t('The testing framework requires the DOMDocument class to be available. Check the configure command at the PHP info page.', array('@link-phpinfo' => url('admin/reports/status/php'))); + $requirements['php_domdocument']['description'] = t('The testing framework requires the DOMDocument class to be available. Check the configure command at the PHP info page.', array('@link-phpinfo' => url('admin/reports/status/php'))); } // SimpleTest currently needs 2 cURL options which are incompatible with // having PHP's open_basedir restriction set. // See http://drupal.org/node/674304. $requirements['php_open_basedir'] = array( - 'title' => $t('PHP open_basedir restriction'), - 'value' => $open_basedir ? $t('Enabled') : $t('Disabled'), + 'title' => t('PHP open_basedir restriction'), + 'value' => $open_basedir ? t('Enabled') : t('Disabled'), ); if ($open_basedir) { $requirements['php_open_basedir']['severity'] = REQUIREMENT_ERROR; - $requirements['php_open_basedir']['description'] = $t('The testing framework requires the PHP open_basedir restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/ini.core.php#ini.open-basedir')); + $requirements['php_open_basedir']['description'] = t('The testing framework requires the PHP open_basedir restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/ini.core.php#ini.open-basedir')); } // Check the current memory limit. If it is set too low, SimpleTest will fail @@ -65,7 +64,7 @@ function simpletest_requirements($phase) { $memory_limit = ini_get('memory_limit'); if (!drupal_check_memory_limit(SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT, $memory_limit)) { $requirements['php_memory_limit']['severity'] = REQUIREMENT_ERROR; - $requirements['php_memory_limit']['description'] = $t('The testing framework requires the PHP memory limit to be at least %memory_minimum_limit. The current value is %memory_limit. Follow these steps to continue.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/node/207036')); + $requirements['php_memory_limit']['description'] = t('The testing framework requires the PHP memory limit to be at least %memory_minimum_limit. The current value is %memory_limit. Follow these steps to continue.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/node/207036')); } return $requirements; diff --git b/core/modules/system/system.api.php a/core/modules/system/system.api.php index 73ec88e..364e383 100644 --- b/core/modules/system/system.api.php +++ a/core/modules/system/system.api.php @@ -2290,8 +2290,6 @@ function hook_file_url_alter(&$uri) { * Drupal itself (by install.php) with an installation profile or later by hand. * As a consequence, install-time requirements must be checked without access * to the full Drupal API, because it is not available during install.php. - * For localization you should for example use $t = get_t() to - * retrieve the appropriate localization function name (t() or st()). * If a requirement has a severity of REQUIREMENT_ERROR, install.php will abort * or at least the module will not install. * Other severity levels have no effect on the installation. @@ -2330,13 +2328,11 @@ function hook_file_url_alter(&$uri) { */ function hook_requirements($phase) { $requirements = array(); - // Ensure translations don't break during installation. - $t = get_t(); // Report Drupal version if ($phase == 'runtime') { $requirements['drupal'] = array( - 'title' => $t('Drupal'), + 'title' => t('Drupal'), 'value' => VERSION, 'severity' => REQUIREMENT_INFO ); @@ -2344,11 +2340,11 @@ function hook_requirements($phase) { // Test PHP version $requirements['php'] = array( - 'title' => $t('PHP'), + 'title' => t('PHP'), 'value' => ($phase == 'runtime') ? l(phpversion(), 'admin/reports/status/php') : phpversion(), ); if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) < 0) { - $requirements['php']['description'] = $t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP)); + $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP)); $requirements['php']['severity'] = REQUIREMENT_ERROR; } @@ -2357,19 +2353,19 @@ function hook_requirements($phase) { $cron_last = state()->get('system.cron_last'); if (is_numeric($cron_last)) { - $requirements['cron']['value'] = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last))); + $requirements['cron']['value'] = t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last))); } else { $requirements['cron'] = array( - 'description' => $t('Cron has not run. It appears cron jobs have not been setup on your system. Check the help pages for configuring cron jobs.', array('@url' => 'http://drupal.org/cron')), + 'description' => t('Cron has not run. It appears cron jobs have not been setup on your system. Check the help pages for configuring cron jobs.', array('@url' => 'http://drupal.org/cron')), 'severity' => REQUIREMENT_ERROR, - 'value' => $t('Never run'), + 'value' => t('Never run'), ); } - $requirements['cron']['description'] .= ' ' . $t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); + $requirements['cron']['description'] .= ' ' . t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); - $requirements['cron']['title'] = $t('Cron maintenance tasks'); + $requirements['cron']['title'] = t('Cron maintenance tasks'); } return $requirements; diff --git b/core/modules/system/system.install a/core/modules/system/system.install index 493db9b..4a6be77 100644 --- b/core/modules/system/system.install +++ a/core/modules/system/system.install @@ -18,13 +18,11 @@ function system_requirements($phase) { global $base_url; $requirements = array(); - // Ensure translations don't break during installation. - $t = get_t(); // Report Drupal version if ($phase == 'runtime') { $requirements['drupal'] = array( - 'title' => $t('Drupal'), + 'title' => t('Drupal'), 'value' => VERSION, 'severity' => REQUIREMENT_INFO, 'weight' => -10, @@ -36,8 +34,8 @@ function system_requirements($phase) { if ($profile != 'standard') { $info = system_get_info('module', $profile); $requirements['install_profile'] = array( - 'title' => $t('Installation profile'), - 'value' => $t('%profile_name (%profile-%version)', array( + 'title' => t('Installation profile'), + 'value' => t('%profile_name (%profile-%version)', array( '%profile_name' => $info['name'], '%profile' => $profile, '%version' => $info['version'] @@ -51,7 +49,7 @@ function system_requirements($phase) { // Web server information. $software = $_SERVER['SERVER_SOFTWARE']; $requirements['webserver'] = array( - 'title' => $t('Web server'), + 'title' => t('Web server'), 'value' => $software, ); @@ -59,21 +57,21 @@ function system_requirements($phase) { $phpversion = phpversion(); if (function_exists('phpinfo')) { $requirements['php'] = array( - 'title' => $t('PHP'), - 'value' => ($phase == 'runtime') ? $phpversion .' ('. l($t('more information'), 'admin/reports/status/php') .')' : $phpversion, + 'title' => t('PHP'), + 'value' => ($phase == 'runtime') ? $phpversion .' ('. l(t('more information'), 'admin/reports/status/php') .')' : $phpversion, ); } else { $requirements['php'] = array( - 'title' => $t('PHP'), + 'title' => t('PHP'), 'value' => $phpversion, - 'description' => $t('The phpinfo() function has been disabled for security reasons. To see your server\'s phpinfo() information, change your PHP settings or contact your server administrator. For more information, Enabling and disabling phpinfo() handbook page.', array('@phpinfo' => 'http://drupal.org/node/243993')), + 'description' => t('The phpinfo() function has been disabled for security reasons. To see your server\'s phpinfo() information, change your PHP settings or contact your server administrator. For more information, Enabling and disabling phpinfo() handbook page.', array('@phpinfo' => 'http://drupal.org/node/243993')), 'severity' => REQUIREMENT_INFO, ); } if (version_compare($phpversion, DRUPAL_MINIMUM_PHP) < 0) { - $requirements['php']['description'] = $t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP)); + $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP)); $requirements['php']['severity'] = REQUIREMENT_ERROR; // If PHP is old, it's not safe to continue with the requirements check. return $requirements; @@ -81,7 +79,7 @@ function system_requirements($phase) { // Test PHP register_globals setting. $requirements['php_register_globals'] = array( - 'title' => $t('PHP register globals'), + 'title' => t('PHP register globals'), ); $register_globals = trim(ini_get('register_globals')); // Unfortunately, ini_get() may return many different values, and we can't @@ -90,17 +88,17 @@ function system_requirements($phase) { // (register_globals off), when it is in fact on. We can only guarantee // register_globals is off if the value returned is 'off', '', or 0. if (!empty($register_globals) && strtolower($register_globals) != 'off') { - $requirements['php_register_globals']['description'] = $t('register_globals is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when register_globals is enabled. The PHP manual has instructions for how to change configuration settings.', array('@url' => 'http://php.net/configuration.changes')); + $requirements['php_register_globals']['description'] = t('register_globals is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when register_globals is enabled. The PHP manual has instructions for how to change configuration settings.', array('@url' => 'http://php.net/configuration.changes')); $requirements['php_register_globals']['severity'] = REQUIREMENT_ERROR; - $requirements['php_register_globals']['value'] = $t("Enabled ('@value')", array('@value' => $register_globals)); + $requirements['php_register_globals']['value'] = t("Enabled ('@value')", array('@value' => $register_globals)); } else { - $requirements['php_register_globals']['value'] = $t('Disabled'); + $requirements['php_register_globals']['value'] = t('Disabled'); } // Test for PHP extensions. $requirements['php_extensions'] = array( - 'title' => $t('PHP extensions'), + 'title' => t('PHP extensions'), ); $missing_extensions = array(); @@ -126,30 +124,30 @@ function system_requirements($phase) { } if (!empty($missing_extensions)) { - $description = $t('Drupal requires you to enable the PHP extensions in the following list (see the system requirements page for more information):', array( + $description = t('Drupal requires you to enable the PHP extensions in the following list (see the system requirements page for more information):', array( '@system_requirements' => 'http://drupal.org/requirements', )); $description .= theme('item_list', array('items' => $missing_extensions)); - $requirements['php_extensions']['value'] = $t('Disabled'); + $requirements['php_extensions']['value'] = t('Disabled'); $requirements['php_extensions']['severity'] = REQUIREMENT_ERROR; $requirements['php_extensions']['description'] = $description; } else { - $requirements['php_extensions']['value'] = $t('Enabled'); + $requirements['php_extensions']['value'] = t('Enabled'); } if ($phase == 'install' || $phase == 'update') { // Test for PDO (database). $requirements['database_extensions'] = array( - 'title' => $t('Database support'), + 'title' => t('Database support'), ); // Make sure PDO is available. $database_ok = extension_loaded('pdo'); if (!$database_ok) { - $pdo_message = $t('Your web server does not appear to support PDO (PHP Data Objects). Ask your hosting provider if they support the native PDO extension. See the system requirements page for more information.', array( + $pdo_message = t('Your web server does not appear to support PDO (PHP Data Objects). Ask your hosting provider if they support the native PDO extension. See the system requirements page for more information.', array( '@link' => 'http://drupal.org/requirements/pdo', )); } @@ -158,7 +156,7 @@ function system_requirements($phase) { $drivers = drupal_detect_database_types(); if (empty($drivers)) { $database_ok = FALSE; - $pdo_message = $t('Your web server does not appear to support any common PDO database extensions. Check with your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases that Drupal supports.', array( + $pdo_message = t('Your web server does not appear to support any common PDO database extensions. Check with your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases that Drupal supports.', array( '@drupal-databases' => 'http://drupal.org/node/270#database', )); } @@ -166,19 +164,19 @@ function system_requirements($phase) { // version. (See install_verify_pdo() for details.) if (!defined('PDO::ATTR_DEFAULT_FETCH_MODE')) { $database_ok = FALSE; - $pdo_message = $t('Your web server seems to have the wrong version of PDO installed. Drupal requires the PDO extension from PHP core. This system has the older PECL version. See the system requirements page for more information.', array( + $pdo_message = t('Your web server seems to have the wrong version of PDO installed. Drupal requires the PDO extension from PHP core. This system has the older PECL version. See the system requirements page for more information.', array( '@link' => 'http://drupal.org/requirements/pdo#pecl', )); } } if (!$database_ok) { - $requirements['database_extensions']['value'] = $t('Disabled'); + $requirements['database_extensions']['value'] = t('Disabled'); $requirements['database_extensions']['severity'] = REQUIREMENT_ERROR; $requirements['database_extensions']['description'] = $pdo_message; } else { - $requirements['database_extensions']['value'] = $t('Enabled'); + $requirements['database_extensions']['value'] = t('Enabled'); } } else { @@ -186,11 +184,11 @@ function system_requirements($phase) { $class = Database::getConnection()->getDriverClass('Install\\Tasks'); $tasks = new $class(); $requirements['database_system'] = array( - 'title' => $t('Database system'), + 'title' => t('Database system'), 'value' => $tasks->name(), ); $requirements['database_system_version'] = array( - 'title' => $t('Database system version'), + 'title' => t('Database system version'), 'value' => Database::getConnection()->version(), ); } @@ -198,31 +196,31 @@ function system_requirements($phase) { // Test PHP memory_limit $memory_limit = ini_get('memory_limit'); $requirements['php_memory_limit'] = array( - 'title' => $t('PHP memory limit'), + 'title' => t('PHP memory limit'), 'value' => $memory_limit == -1 ? t('-1 (Unlimited)') : $memory_limit, ); if (!drupal_check_memory_limit(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, $memory_limit)) { $description = ''; if ($phase == 'install') { - $description = $t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the installation process.', array('%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)); + $description = t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the installation process.', array('%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)); } elseif ($phase == 'update') { - $description = $t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the update process.', array('%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)); + $description = t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the update process.', array('%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)); } elseif ($phase == 'runtime') { - $description = $t('Depending on your configuration, Drupal can run with a %memory_limit PHP memory limit. However, a %memory_minimum_limit PHP memory limit or above is recommended, especially if your site uses additional custom or contributed modules.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)); + $description = t('Depending on your configuration, Drupal can run with a %memory_limit PHP memory limit. However, a %memory_minimum_limit PHP memory limit or above is recommended, especially if your site uses additional custom or contributed modules.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)); } if (!empty($description)) { if ($php_ini_path = get_cfg_var('cfg_file_path')) { - $description .= ' ' . $t('Increase the memory limit by editing the memory_limit parameter in the file %configuration-file and then restart your web server (or contact your system administrator or hosting provider for assistance).', array('%configuration-file' => $php_ini_path)); + $description .= ' ' . t('Increase the memory limit by editing the memory_limit parameter in the file %configuration-file and then restart your web server (or contact your system administrator or hosting provider for assistance).', array('%configuration-file' => $php_ini_path)); } else { - $description .= ' ' . $t('Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.'); + $description .= ' ' . t('Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.'); } - $requirements['php_memory_limit']['description'] = $description . ' ' . $t('For more information, see the online handbook entry for increasing the PHP memory limit.', array('@memory-limit' => 'http://drupal.org/node/207036')); + $requirements['php_memory_limit']['description'] = $description . ' ' . t('For more information, see the online handbook entry for increasing the PHP memory limit.', array('@memory-limit' => 'http://drupal.org/node/207036')); $requirements['php_memory_limit']['severity'] = REQUIREMENT_WARNING; } } @@ -232,12 +230,12 @@ function system_requirements($phase) { $conf_errors = array(); $conf_path = conf_path(); if (!drupal_verify_install_file($conf_path, FILE_NOT_WRITABLE, 'dir')) { - $conf_errors[] = $t("The directory %file is not protected from modifications and poses a security risk. You must change the directory's permissions to be non-writable.", array('%file' => $conf_path)); + $conf_errors[] = t("The directory %file is not protected from modifications and poses a security risk. You must change the directory's permissions to be non-writable.", array('%file' => $conf_path)); } foreach (array('settings.php', 'settings.local.php') as $conf_file) { $full_path = $conf_path . '/' . $conf_file; if (file_exists($full_path) && !drupal_verify_install_file($full_path, FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE)) { - $conf_errors[] = $t("The file %file is not protected from modifications and poses a security risk. You must change the file's permissions to be non-writable.", array('%file' => $full_path)); + $conf_errors[] = t("The file %file is not protected from modifications and poses a security risk. You must change the file's permissions to be non-writable.", array('%file' => $full_path)); } } if (!empty($conf_errors)) { @@ -248,17 +246,17 @@ function system_requirements($phase) { $description = theme('item_list', array('items' => $conf_errors)); } $requirements['settings.php'] = array( - 'value' => $t('Not protected'), + 'value' => t('Not protected'), 'severity' => REQUIREMENT_ERROR, 'description' => $description, ); } else { $requirements['settings.php'] = array( - 'value' => $t('Protected'), + 'value' => t('Protected'), ); } - $requirements['settings.php']['title'] = $t('Configuration files'); + $requirements['settings.php']['title'] = t('Configuration files'); } // Report cron status. @@ -269,7 +267,7 @@ function system_requirements($phase) { // Cron error threshold defaults to two weeks. $threshold_error = $cron_config->get('threshold.requirements_error'); // Cron configuration help text. - $help = $t('For more information, see the online handbook entry for configuring cron jobs.', array('@cron-handbook' => 'http://drupal.org/cron')); + $help = t('For more information, see the online handbook entry for configuring cron jobs.', array('@cron-handbook' => 'http://drupal.org/cron')); // Determine when cron last ran. $cron_last = state()->get('system.cron_last'); @@ -287,17 +285,17 @@ function system_requirements($phase) { } // Set summary and description based on values determined above. - $summary = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last))); + $summary = t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last))); $description = ''; if ($severity != REQUIREMENT_INFO) { - $description = $t('Cron has not run recently.') . ' ' . $help; + $description = t('Cron has not run recently.') . ' ' . $help; } - $description .= ' ' . $t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); - $description .= '
' . $t('To run cron from outside the site, go to !cron', array('!cron' => url('cron/' . state()->get('system.cron_key'), array('absolute' => TRUE)))); + $description .= ' ' . t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); + $description .= '
' . t('To run cron from outside the site, go to !cron', array('!cron' => url('cron/' . state()->get('system.cron_key'), array('absolute' => TRUE)))); $requirements['cron'] = array( - 'title' => $t('Cron maintenance tasks'), + 'title' => t('Cron maintenance tasks'), 'severity' => $severity, 'value' => $summary, 'description' => $description @@ -350,15 +348,15 @@ function system_requirements($phase) { } elseif ($phase != 'install') { $requirements['config directories'] = array( - 'title' => $t('Configuration directories'), - 'value' => $t('Not present'), - 'description' => $t('Your %file file must define the $config_directories variable as an array containing the name of a directories in which configuration files can be written.', array('%file' => conf_path() . '/settings.php')), + 'title' => t('Configuration directories'), + 'value' => t('Not present'), + 'description' => t('Your %file file must define the $config_directories variable as an array containing the name of a directories in which configuration files can be written.', array('%file' => conf_path() . '/settings.php')), 'severity' => REQUIREMENT_ERROR, ); } $requirements['file system'] = array( - 'title' => $t('File system'), + 'title' => t('File system'), ); $error = ''; @@ -374,21 +372,21 @@ function system_requirements($phase) { $is_directory = is_dir($directory); if (!$is_writable || !$is_directory) { $description = ''; - $requirements['file system']['value'] = $t('Not writable'); + $requirements['file system']['value'] = t('Not writable'); if (!$is_directory) { - $error .= $t('The directory %directory does not exist.', array('%directory' => $directory)) . ' '; + $error .= t('The directory %directory does not exist.', array('%directory' => $directory)) . ' '; } else { - $error .= $t('The directory %directory is not writable.', array('%directory' => $directory)) . ' '; + $error .= t('The directory %directory is not writable.', array('%directory' => $directory)) . ' '; } // The files directory requirement check is done only during install and runtime. if ($phase == 'runtime') { - $description = $error . $t('You may need to set the correct directory at the file system settings page or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => url('admin/config/media/file-system'))); + $description = $error . t('You may need to set the correct directory at the file system settings page or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => url('admin/config/media/file-system'))); } elseif ($phase == 'install') { // For the installer UI, we need different wording. 'value' will // be treated as version, so provide none there. - $description = $error . $t('An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see INSTALL.txt or the online handbook.', array('@handbook_url' => 'http://drupal.org/server-permissions')); + $description = $error . t('An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see INSTALL.txt or the online handbook.', array('@handbook_url' => 'http://drupal.org/server-permissions')); $requirements['file system']['value'] = ''; } if (!empty($description)) { @@ -400,10 +398,10 @@ function system_requirements($phase) { // This function can be called before the config_cache table has been // created. if ($phase == 'install' || file_default_scheme() == 'public') { - $requirements['file system']['value'] = $t('Writable (public download method)'); + $requirements['file system']['value'] = t('Writable (public download method)'); } else { - $requirements['file system']['value'] = $t('Writable (private download method)'); + $requirements['file system']['value'] = t('Writable (private download method)'); } } } @@ -411,8 +409,8 @@ function system_requirements($phase) { // See if updates are available in update.php. if ($phase == 'runtime') { $requirements['update'] = array( - 'title' => $t('Database updates'), - 'value' => $t('Up to date'), + 'title' => t('Database updates'), + 'value' => t('Up to date'), ); // Check installed modules. @@ -422,8 +420,8 @@ function system_requirements($phase) { $default = drupal_get_installed_schema_version($module); if (max($updates) > $default) { $requirements['update']['severity'] = REQUIREMENT_ERROR; - $requirements['update']['value'] = $t('Out of date'); - $requirements['update']['description'] = $t('Some modules have database schema updates to install. You should run the database update script immediately.', array('@update' => base_path() . 'core/update.php')); + $requirements['update']['value'] = t('Out of date'); + $requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the database update script immediately.', array('@update' => base_path() . 'core/update.php')); break; } } @@ -434,17 +432,17 @@ function system_requirements($phase) { if ($phase == 'runtime') { if (settings()->get('update_free_access')) { $requirements['update access'] = array( - 'value' => $t('Not protected'), + 'value' => t('Not protected'), 'severity' => REQUIREMENT_ERROR, - 'description' => $t('The update.php script is accessible to everyone without authentication check, which is a security risk. You must change the @settings_name value in your settings.php back to FALSE.', array('@settings_name' => '$settings[\'update_free_access\']')), + 'description' => t('The update.php script is accessible to everyone without authentication check, which is a security risk. You must change the @settings_name value in your settings.php back to FALSE.', array('@settings_name' => '$settings[\'update_free_access\']')), ); } else { $requirements['update access'] = array( - 'value' => $t('Protected'), + 'value' => t('Protected'), ); } - $requirements['update access']['title'] = $t('Access to update.php'); + $requirements['update access']['title'] = t('Access to update.php'); } // Display an error if a newly introduced dependency in a module is not resolved. @@ -460,7 +458,7 @@ function system_requirements($phase) { $name = $file->info['name']; $php = $file->info['php']; if (version_compare($php, PHP_VERSION, '>')) { - $requirements['php']['description'] .= $t('@name requires at least PHP @version.', array('@name' => $name, '@version' => $php)); + $requirements['php']['description'] .= t('@name requires at least PHP @version.', array('@name' => $name, '@version' => $php)); $requirements['php']['severity'] = REQUIREMENT_ERROR; } // Check the module's required modules. @@ -469,8 +467,8 @@ function system_requirements($phase) { // Check if the module exists. if (!isset($files[$required_module])) { $requirements["$module-$required_module"] = array( - 'title' => $t('Unresolved dependency'), - 'description' => $t('@name requires this module.', array('@name' => $name)), + 'title' => t('Unresolved dependency'), + 'description' => t('@name requires this module.', array('@name' => $name)), 'value' => t('@required_name (Missing)', array('@required_name' => $required_module)), 'severity' => REQUIREMENT_ERROR, ); @@ -484,8 +482,8 @@ function system_requirements($phase) { if ($compatibility) { $compatibility = rtrim(substr($compatibility, 2), ')'); $requirements["$module-$required_module"] = array( - 'title' => $t('Unresolved dependency'), - 'description' => $t('@name requires this module and version. Currently using @required_name version @version', array('@name' => $name, '@required_name' => $required_name, '@version' => $version)), + 'title' => t('Unresolved dependency'), + 'description' => t('@name requires this module and version. Currently using @required_name version @version', array('@name' => $name, '@required_name' => $required_name, '@version' => $version)), 'value' => t('@required_name (Version @compatibility required)', array('@required_name' => $required_name, '@compatibility' => $compatibility)), 'severity' => REQUIREMENT_ERROR, ); @@ -503,17 +501,17 @@ function system_requirements($phase) { // Check for update status module. if (!module_exists('update')) { $requirements['update status'] = array( - 'value' => $t('Not enabled'), + 'value' => t('Not enabled'), 'severity' => REQUIREMENT_WARNING, - 'description' => $t('Update notifications are not enabled. It is highly recommended that you enable the Update Manager module from the module administration page in order to stay up-to-date on new releases. For more information, Update status handbook page.', array('@update' => 'http://drupal.org/documentation/modules/update', '@module' => url('admin/modules'))), + 'description' => t('Update notifications are not enabled. It is highly recommended that you enable the Update Manager module from the module administration page in order to stay up-to-date on new releases. For more information, Update status handbook page.', array('@update' => 'http://drupal.org/documentation/modules/update', '@module' => url('admin/modules'))), ); } else { $requirements['update status'] = array( - 'value' => $t('Enabled'), + 'value' => t('Enabled'), ); } - $requirements['update status']['title'] = $t('Update notifications'); + $requirements['update status']['title'] = t('Update notifications'); } return $requirements; diff --git b/core/modules/system/tests/modules/requirements1_test/requirements1_test.install a/core/modules/system/tests/modules/requirements1_test/requirements1_test.install index 91caca3..80220b9 100644 --- b/core/modules/system/tests/modules/requirements1_test/requirements1_test.install +++ a/core/modules/system/tests/modules/requirements1_test/requirements1_test.install @@ -5,15 +5,13 @@ */ function requirements1_test_requirements($phase) { $requirements = array(); - // Ensure translations don't break during installation. - $t = get_t(); // Always fails requirements. if ('install' == $phase) { $requirements['requirements1_test'] = array( - 'title' => $t('Requirements 1 Test'), + 'title' => t('Requirements 1 Test'), 'severity' => REQUIREMENT_ERROR, - 'description' => $t('Requirements 1 Test failed requirements.'), + 'description' => t('Requirements 1 Test failed requirements.'), ); } diff --git b/core/modules/user/user.install a/core/modules/user/user.install index dca417c..4a3da4d 100644 --- b/core/modules/user/user.install +++ a/core/modules/user/user.install @@ -302,7 +302,6 @@ function user_install() { * helper function so that other install profiles can reuse it. */ function user_install_picture_field() { - $t = get_t(); $field = array( 'field_name' => 'user_picture', @@ -323,7 +322,7 @@ function user_install_picture_field() { 'entity_type' => 'user', 'label' => 'Picture', 'bundle' => 'user', - 'description' => $t('Your virtual face or picture.'), + 'description' => t('Your virtual face or picture.'), 'required' => FALSE, 'settings' => array( 'file_extensions' => 'png gif jpg jpeg', diff --git b/core/scripts/update-iso-3166.sh a/core/scripts/update-iso-3166.sh index f6e0f0a..128af18 100644 --- b/core/scripts/update-iso-3166.sh +++ a/core/scripts/update-iso-3166.sh @@ -61,7 +61,7 @@ // For .po translation file's sake, use double-quotes instead of escaped // single-quotes. $name = (strpos($name, '\'') !== FALSE ? '"' . $name . '"' : "'" . $name . "'"); - $out .= ' ' . var_export($code, TRUE) . ' => $t(' . $name . '),' . "\n"; + $out .= ' ' . var_export($code, TRUE) . ' => t(' . $name . '),' . "\n"; } // Replace the actual PHP code in standard.inc. @@ -70,12 +70,3 @@ $content = preg_replace('/(\$countries = array\(\n)(.+?)(^\s+\);)/ms', '$1' . $out . '$3', $content); file_put_contents($file, $content); - -/** - * No-op script helper. - */ -function get_t() { - return function ($string) { - return $string; - }; -}