diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 4 | ||||
-rw-r--r-- | includes/database.pear.inc | 4 | ||||
-rw-r--r-- | includes/file.inc | 18 | ||||
-rw-r--r-- | includes/locale.inc | 50 |
4 files changed, 38 insertions, 38 deletions
diff --git a/includes/common.inc b/includes/common.inc index cda083867..f8e5654dd 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -237,7 +237,7 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL) { */ function drupal_not_found() { header('HTTP/1.0 404 Not Found'); - watchdog('httpd', t('404 error: "%page" not found', array('%page' => check_query($_GET['q'])))); + watchdog('httpd', t('404 error: %page not found.', array('%page' => '<em>'. check_query($_GET['q']) .'</em>'))); $path = drupal_get_normal_path(variable_get('site_404', '')); $status = MENU_NOT_FOUND; @@ -651,7 +651,7 @@ function valid_input_data($data) { $match += preg_match("/<\s*(applet|script|object|style|embed|form|blink|meta|html|frame|iframe|layer|ilayer|head|frameset|xml)/i", $data); if ($match) { - watchdog('warning', t('terminated request because of suspicious input data: %data', array('%data' => drupal_specialchars($data)))); + watchdog('warning', t('Terminated request because of suspicious input data: %data.', array('%data' => '<em>'. drupal_specialchars($data) .'</em>'))); return FALSE; } } diff --git a/includes/database.pear.inc b/includes/database.pear.inc index 529cb0afa..fc8da8f91 100644 --- a/includes/database.pear.inc +++ b/includes/database.pear.inc @@ -203,7 +203,7 @@ function db_next_id($name) { $name = db_prefix_tables($name); $result = $active_db->nextID($name); if (DB::isError($result)) { - watchdog('error', t('database: %db\nsequence table: %name', array('%db' => $result->getMessage(), '%name' => $name))); + watchdog('error', t('Database: %db sequence table: %name.', array('%db' => '<em>'. $result->getMessage() .'</em>', '%name' => "<em>$name</em>"))); } else { return $result; @@ -271,7 +271,7 @@ function db_query_range($query) { } if (DB::isError($result)) { - watchdog('error', t('database: %db\nquery: %query', array('%db' => $result->getMessage(), '%query' => htmlspecialchars($query)))); + watchdog('error', t('Database: %db query: %query.', array('%db' => '<em>'. $result->getMessage() .'</em>', '%query' => '<em>'. htmlspecialchars($query) .'</em>'))); } else { return $result; diff --git a/includes/file.inc b/includes/file.inc index abbd16c90..6b8fbf7fb 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -61,11 +61,11 @@ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) { // Check if directory exists. if (!is_dir($directory)) { if (($mode & FILE_CREATE_DIRECTORY) && mkdir($directory, 0760)) { - drupal_set_message(t("Created directory '%name'.", array('%name' => $directory))); + drupal_set_message(t('Created directory %directory.', array('%directory' => "<em>$directory</em>"))); } else { if ($form_item) { - form_set_error($form_item, t("The directory '%name' does not exist.", array('%name' => $directory))); + form_set_error($form_item, t('The directory %directory does not exist.', array('%directory' => "<em>$directory</em>"))); } return false; } @@ -74,10 +74,10 @@ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) { // Check to see if the directory is writable. if (!is_writable($directory)) { if (($mode & FILE_MODIFY_PERMISSIONS) && chmod($directory, 0760)) { - drupal_set_message(t("Modified permissions on directory '%name'.", array('%name' => $directory))); + drupal_set_message(t('Modified permissions on directory %directory.', array('%directory' => "<em>$directory</em>"))); } else { - form_set_error($form_item, t("The directory '%name' is not writable.", array('%name' => $directory))); + form_set_error($form_item, t('The directory %directory is not writable.', array('%directory' => "<em>$directory</em>"))); return false; } } @@ -314,7 +314,7 @@ function file_save_upload($source, $dest = 0, $replace = 0) { if (!valid_input_data($file)) { watchdog('error', t('Possible exploit abuse: invalid data.')); - drupal_set_message(t("File upload failed: invalid data."), 'error'); + drupal_set_message(t('File upload failed: invalid data.'), 'error'); return 0; } @@ -324,14 +324,14 @@ function file_save_upload($source, $dest = 0, $replace = 0) { break; case 1: // UPLOAD_ERR_INI_SIZE case 2: // UPLOAD_ERR_FORM_SIZE - drupal_set_message(t("File upload failed: file size too big."), 'error'); + drupal_set_message(t('File upload failed: file size too big.'), 'error'); return 0; case 3: // UPLOAD_ERR_PARTIAL case 4: // UPLOAD_ERR_NO_FILE - drupal_set_message(t("File upload failed: incomplete upload."), 'error'); + drupal_set_message(t('File upload failed: incomplete upload.'), 'error'); return 0; default: // Unknown error - drupal_set_message(t("File upload failed: unknown error."), 'error'); + drupal_set_message(t('File upload failed: unknown error.'), 'error'); return 0; } @@ -358,7 +358,7 @@ function file_save_upload($source, $dest = 0, $replace = 0) { function file_save_data($data, $dest, $replace = 0) { if (!valid_input_data($data)) { watchdog('error', t('Possible exploit abuse: invalid data.')); - drupal_set_message(t("File upload failed: invalid data."), 'error'); + drupal_set_message(t('File upload failed: invalid data.'), 'error'); return 0; } diff --git a/includes/locale.inc b/includes/locale.inc index 9f6c912f6..04c846444 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -24,14 +24,14 @@ function _locale_add_language($code, $name, $onlylanguage = TRUE) { // the language addition, we need to inform the user on how to start // a translation if ($onlylanguage) { - $message = t("'%locale' language added. You can now import a translation. See the <a href=\"%locale-help\">help screen</a> for more information.", array('%locale' => t($name), '%locale-help' => url("admin/help/locale"))); + $message = t('%locale language added. You can now import a translation. See the <a href="%locale-help">help screen</a> for more information.', array('%locale' => '<em>'. t($name) .'</em>', '%locale-help' => url('admin/help/locale'))); } else { - $message = t("'%locale' language added.", array('%locale' => t($name))); + $message = t('%locale language added.', array('%locale' => '<em>'. t($name) .'</em>')); } drupal_set_message($message); - watchdog('locale', t("'%locale' language added.", array('%locale' => $code))); + watchdog('locale', t('%locale language added.', array('%locale' => "<em>$code</em>"))); } /** @@ -122,13 +122,13 @@ function _locale_admin_import_screen() { function _locale_import_po($file, $lang, $mode) { // Check if we have the language already in the database if (!db_fetch_object(db_query("SELECT locale FROM {locales_meta} WHERE locale = '%s'", $lang))) { - drupal_set_message(t("Unsupported language selected for import."), 'error'); + drupal_set_message(t('Unsupported language selected for import.'), 'error'); return FALSE; } // Check if we can get the strings from the file if (!($strings = _locale_import_read_po($file))) { - drupal_set_message(t("Translation file broken: Couldn't be read."), 'error'); + drupal_set_message(t('Translation file broken: Could not be read.'), 'error'); return FALSE; } @@ -150,7 +150,7 @@ function _locale_import_po($file, $lang, $mode) { } } else { - drupal_set_message(t("Translation file broken: No header."), 'error'); + drupal_set_message(t('Translation file broken: no header.'), 'error'); return FALSE; } @@ -221,8 +221,8 @@ function _locale_import_po($file, $lang, $mode) { // Successfull import cache_clear_all("locale:$lang"); - drupal_set_message(t("Translation successfully imported. %num translated strings added to language.", array('%num' => $fullstr))); - watchdog('locale', strtr("Translation imported into '%locale', %num translated strings added to language.", array('%locale' => $lang, '%num' => $fullstr))); + drupal_set_message(t('Translation successfully imported. %number translated strings added to language.', array('%number' => $fullstr))); + watchdog('locale', t('Translation imported into %locale, %num translated strings added to language.', array('%locale' => "<em>$lang</em>", '%num' => $fullstr))); return TRUE; } @@ -236,7 +236,7 @@ function _locale_import_read_po($path) { $fd = fopen($path, "rb"); if (!$fd) { - drupal_set_message(t("Translation import failed: File '%path' cannot be read.", array("%path" => $path)), 'error'); + drupal_set_message(t('Translation import failed: file %filename cannot be read.', array('%filename' => "<em>$path</em>")), 'error'); return FALSE; } $info = fstat($fd); @@ -268,19 +268,19 @@ function _locale_import_read_po($path) { $context = "COMMENT"; } else { // Parse error - drupal_set_message(t("Translation file broken: Expected \"msgstr\" in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t("Translation file broken: expected 'msgstr' in line %line.", array('%line' => $lineno)), 'error'); return FALSE; } } elseif (!strncmp("msgid_plural", $line, 12)) { if ($context != "MSGID") { // Must be plural form for current entry - drupal_set_message(t("Translation file broken: Unexpected \"msgid_plural\" in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t("Translation file broken: unexpected 'msgid_plural' in line %line.", array('%line' => $lineno)), 'error'); return FALSE; } $line = trim(substr($line, 12)); $quoted = _locale_import_parse_quoted($line); if ($quoted === false) { - drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error'); return FALSE; } $current["msgid"] = $current["msgid"] ."\0". $quoted; @@ -292,13 +292,13 @@ function _locale_import_read_po($path) { $current = array(); } elseif ($context == "MSGID") { // Already in this context? Parse error - drupal_set_message(t("Translation file broken: Unexpected \"msgid\" in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t("Translation file broken: unexpected 'msgid' in line %line.", array('%line' => $lineno)), 'error'); return FALSE; } $line = trim(substr($line, 5)); $quoted = _locale_import_parse_quoted($line); if ($quoted === false) { - drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error'); return FALSE; } $current["msgid"] = $quoted; @@ -306,11 +306,11 @@ function _locale_import_read_po($path) { } elseif (!strncmp("msgstr[", $line, 7)) { if (($context != "MSGID") && ($context != "MSGID_PLURAL") && ($context != "MSGSTR_ARR")) { // Must come after msgid, msgid_plural, or msgstr[] - drupal_set_message(t("Translation file broken: Unexpected \"msgstr[]\" in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t("Translation file broken: unexpected 'msgstr[]' in line %line.", array('%line' => $lineno)), 'error'); return FALSE; } if (strpos($line, "]") === false) { - drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error'); return FALSE; } $frombracket = strstr($line, "["); @@ -318,7 +318,7 @@ function _locale_import_read_po($path) { $line = trim(strstr($line, " ")); $quoted = _locale_import_parse_quoted($line); if ($quoted === false) { - drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error'); return FALSE; } $current["msgstr"][$plural] = $quoted; @@ -326,13 +326,13 @@ function _locale_import_read_po($path) { } elseif (!strncmp("msgstr", $line, 6)) { if ($context != "MSGID") { // Should come just after a msgid block - drupal_set_message(t("Translation file broken: Unexpected \"msgstr\" in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t("Translation file broken: unexpected 'msgstr' in line %line.", array('%line' => $lineno)), 'error'); return FALSE; } $line = trim(substr($line, 6)); $quoted = _locale_import_parse_quoted($line); if ($quoted === false) { - drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error'); return FALSE; } $current["msgstr"] = $quoted; @@ -341,7 +341,7 @@ function _locale_import_read_po($path) { elseif ($line != "") { $quoted = _locale_import_parse_quoted($line); if ($quoted === false) { - drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error'); return FALSE; } if (($context == "MSGID") || ($context == "MSGID_PLURAL")) { @@ -354,7 +354,7 @@ function _locale_import_read_po($path) { $current["msgstr"][$plural] .= $quoted; } else { - drupal_set_message(t("Translation file broken: Unexpected string in line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t('Translation file broken: unexpected string in line %line.', array('%line' => $lineno)), 'error'); return FALSE; } } @@ -365,7 +365,7 @@ function _locale_import_read_po($path) { $strings[$current["msgid"]] = $current; } elseif ($context != "COMMENT") { - drupal_set_message(t("Translation file broken: Unexpected end file at line %lineno", array("%lineno" => $lineno)), 'error'); + drupal_set_message(t('Translation file broken: unexpected end file at line %line.', array('%line' => $lineno)), 'error'); return FALSE; } @@ -429,7 +429,7 @@ function _locale_import_parse_plural_forms($pluralforms) { return array($nplurals, $plural); } else { - drupal_set_message(t("Translation file broken: Plural formula couldn't get parsed."), 'error'); + drupal_set_message(t("Translation file broken: plural formula couldn't get parsed."), 'error'); return FALSE; } } @@ -730,7 +730,7 @@ function _locale_export_po($language) { $header .= "\"Plural-Forms: nplurals=". $meta->plurals ."; plural=". strtr($meta->formula, '$', '') .";\\n\"\n"; } $header .= "\n"; - watchdog('locale', strtr("PO file for locale '%loc' downloaded.", array('%loc' => $meta->name))); + watchdog('locale', t('PO file for locale %locale downloaded.', array('%locale' => "<em>$meta->name</em>"))); } // Generating Portable Object Template @@ -751,7 +751,7 @@ function _locale_export_po($language) { $header .= "\"Content-Transfer-Encoding: 8bit\\n\"\n"; $header .= "\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n\"\n"; $header .= "\n"; - watchdog('locale', 'POT file downloaded.'); + watchdog('locale', t('POT file downloaded.')); } // Start download process |