Index: includes/file.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/file.inc,v retrieving revision 1.39 diff -u -F^f -r1.39 file.inc --- includes/file.inc 31 Mar 2005 21:18:08 -0000 1.39 +++ includes/file.inc 25 Apr 2005 01:24:23 -0000 @@ -76,7 +76,7 @@ function file_check_directory(&$director // Check if directory exists. if (!is_dir($directory)) { if (($mode & FILE_CREATE_DIRECTORY) && @mkdir($directory, 0760)) { - drupal_set_message(t('Created directory %directory.', array('%directory' => theme('placeholder', $directory)))); + drupal_set_message(t('The directory %directory has been created.', array('%directory' => theme('placeholder', $directory)))); } else { if ($form_item) { @@ -89,10 +89,11 @@ function file_check_directory(&$director // 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 %directory.', array('%directory' => theme('placeholder', $directory)))); + drupal_set_message(t('The permissions of directory %directory have been changed to make it writable.', array('%directory' => theme('placeholder', $directory)))); } else { - form_set_error($form_item, t('The directory %directory is not writable.', array('%directory' => theme('placeholder', $directory)))); + form_set_error($form_item, t('The directory %directory is not writable', array('%directory' => theme('placeholder', $directory)))); + watchdog('file system', t('The directory %directory is not writable, because it does not have the correct permissions set.', array('%directory' => theme('placeholder', $directory))), WATCHDOG_ERROR); return false; } } @@ -199,7 +200,8 @@ function file_copy(&$source, $dest = 0, // Make sure we at least have a valid directory. if ($basename === false) { - drupal_set_message(t('File copy failed: no directory configured, or it could not be accessed.'), 'error'); + drupal_set_message(t('The selected file %file could not be uploaded, because the destination %directory is not properly configured.', array('%file' => theme('placeholder', $source), '%directory' => theme('placeholder', $dest))), 'error'); + watchdog('file system', t('The selected file %file could not not be uploaded, because the destination %directory could not be found, or because its permissions do not allow the file to be written.', array('%file' => theme('placeholder', $source), '%directory' => theme('placeholder', $dest))), WATCHDOG_ERROR); return 0; } @@ -214,11 +216,11 @@ function file_copy(&$source, $dest = 0, $source = realpath($source); if (!file_exists($source)) { - drupal_set_message(t('File copy failed: source file does not exist.'), 'error'); + drupal_set_message(t('The selected file %file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.', array('%file' => theme('placeholder', $source))), 'error'); return 0; } - // If destination file is not specified then use filename of source file. + // If the destination file is not specified then use the filename of the source file. $basename = $basename ? $basename : basename($source); $dest = $directory .'/'. $basename; @@ -246,7 +248,7 @@ function file_copy(&$source, $dest = 0, break; case FILE_EXISTS_ERROR: - drupal_set_message(t('File copy failed. File already exists.'), 'error'); + drupal_set_message(t('The selected file %file could not be copied, because a file by that name already exists in the destination.', array('%file' => theme('placeholder', $source))), 'error'); return 0; case FILE_EXISTS_REPLACE: @@ -255,7 +257,7 @@ function file_copy(&$source, $dest = 0, } if (!@copy($source, $dest)) { - drupal_set_message(t('File copy failed.'), 'error'); + drupal_set_message(t('The selected file %file could not be copied.', array('%file' => theme('placeholder', $source))), 'error'); return 0; } } @@ -299,7 +301,7 @@ function file_move(&$source, $dest = 0, if ($path_original == $path_current || file_delete($path_original)) { return 1; } - drupal_set_message(t('Removing original file failed.'), 'error'); + drupal_set_message(t('The removal of the original file %file has failed.', array('%file' => theme('placeholder', $source))), 'error'); } return 0; } @@ -358,25 +360,25 @@ function file_save_upload($source, $dest } if (!user_access('bypass input data check') && !valid_input_data($file)) { - watchdog('security', t('Possible exploit abuse: invalid data.'), WATCHDOG_WARNING); - drupal_set_message(t('File upload failed: invalid data.'), 'error'); + watchdog('security', t('The file %file has not been saved, because it may contain a possible attempt to exploit or abuse this system.', array('%file' => theme('placeholder', $source))), WATCHDOG_WARNING); + drupal_set_message(t('The file %file has not been saved, because it contains invalid data.', array('%file' => theme('placeholder', $source))), 'error'); return 0; } // Check for file upload errors. switch ($file->error) { - case 0: // UPLOAD_ERR_OK + case 0: // UPLOAD_ERR_OK: File¨›uploaded¨›successfully 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'); + case 1: // UPLOAD_ERR_INI_SIZE: File¨›size¨›exceeded¨›php.ini¨›value + case 2: // UPLOAD_ERR_FORM_SIZE: File¨›size¨›exceeded¨›MAX_FILE_SIZE¨›form¨›value + drupal_set_message(t('The file %file could not be saved, because it exceeds the maximum allowed size for uploads.', array('%file' => theme('placeholder', $source))), 'error'); return 0; - case 3: // UPLOAD_ERR_PARTIAL - case 4: // UPLOAD_ERR_NO_FILE - drupal_set_message(t('File upload failed: incomplete upload.'), 'error'); + case 3: // UPLOAD_ERR_PARTIAL: File¨›was¨›only¨›partially¨›uploaded + case 4: // UPLOAD_ERR_NO_FILE: No¨›file¨›was¨›uploaded + drupal_set_message(t('The file %file could not be saved, because the upload did not complete.', array('%file' => theme('placeholder', $source))), 'error'); return 0; default: // Unknown error - drupal_set_message(t('File upload failed: unknown error.'), 'error'); + drupal_set_message(t('The file %file could not be saved. An unknown error has occurred.', array('%file' => theme('placeholder', $source))),'error'); return 0; } @@ -402,15 +404,15 @@ function file_save_upload($source, $dest */ function file_save_data($data, $dest, $replace = FILE_EXISTS_RENAME) { if (!user_access('bypass input data check') && !valid_input_data($data)) { - watchdog('security', t('Possible exploit abuse: invalid data.'), WATCHDOG_WARNING); - drupal_set_message(t('File upload failed: invalid data.'), 'error'); + watchdog('security', t('The file has not been saved, because it may contain a possible attempt to exploit or abuse this system.'), WATCHDOG_WARNING); + drupal_set_message(t('The file has not been saved, because it contains invalid data.'), 'error'); return 0; } $temp = variable_get('file_directory_temp', FILE_DIRECTORY_TEMP); $file = tempnam($temp, 'file'); if (!$fp = fopen($file, 'wb')) { - drupal_set_message(t('Unable to create file.'), 'error'); + drupal_set_message(t('The file could not be created.'), 'error'); return 0; } fwrite($fp, $data); Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.42 diff -u -F^f -r1.42 locale.inc --- includes/locale.inc 2 Apr 2005 18:22:17 -0000 1.42 +++ includes/locale.inc 25 Apr 2005 01:24:24 -0000 @@ -23,14 +23,13 @@ function _locale_add_language($code, $na // 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 help screen for more information.', array('%locale' => theme('placeholder', t($name)), '%locale-help' => url('admin/help/locale'))); + drupal_set_message(t('The language %locale has been created, and can now be used to import a translation. More information is available in the help screen.', array('%locale' => theme('placeholder', t($name)), '%locale-help' => url('admin/help/locale'))); } else { - $message = t('%locale language added.', array('%locale' => theme('placeholder', t($name)))); + drupal_set_message(t('The language %locale has been created.', array('%locale' => theme('placeholder', t($name))))); } - drupal_set_message($message); - watchdog('locale', t('%language language (%locale) added.', array('%language' => theme('placeholder', $name), '%locale' => theme('placeholder', $code)))); + watchdog('locale', t('The %language language (%locale) has been created.', array('%language' => theme('placeholder', $name), '%locale' => theme('placeholder', $code)))); } /** @@ -126,13 +125,13 @@ function _locale_import_po($file, $lang, // 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('The language selected for import is not supported.'), '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 %filename broken: Could not be read.', array('%filename' => theme('placeholder', $file->filename))), 'error'); + drupal_set_message(t('The translation file %filename appears to contain errors and could not be read.', array('%filename' => theme('placeholder', $file->filename))), 'error'); return FALSE; } @@ -154,7 +153,7 @@ function _locale_import_po($file, $lang, } } else { - drupal_set_message(t('Translation file %filename broken: No header.', array('%filename' => theme('placeholder', $file->filename))), 'error'); + drupal_set_message(t('The translation file %filename appears to have a missing or malformed header.', array('%filename' => theme('placeholder', $file->filename))), 'error'); return FALSE; } @@ -256,7 +255,7 @@ function _locale_import_po($file, $lang, // rebuild the menu, strings may have changed menu_rebuild(); - drupal_set_message(t('Translation successfully imported. %number translated strings added to language, %update strings updated.', array('%number' => $additions, '%update' => $updates))); + drupal_set_message(t('The translation was successfully imported. There are %number newly created translated strings and %update strings were updated.', array('%number' => $additions, '%update' => $updates))); watchdog('locale', t('Imported %file into %locale: %number new strings added and %update updated.', array('%file' => theme('placeholder', $file->filename), '%locale' => theme('placeholder', $lang), '%number' => $additions, '%update' => $updates))); return TRUE; } @@ -272,7 +271,7 @@ function _locale_import_read_po($file) { $message = theme('placeholder', $file->filename); $fd = fopen($file->filepath, "rb"); if (!$fd) { - drupal_set_message(t('Translation import failed: file %filename cannot be read.', array('%filename' => $message)), 'error'); + drupal_set_message(t('The translation import failed, because the file %filename could not be read.', array('%filename' => $message)), 'error'); return FALSE; } $info = fstat($fd); @@ -304,19 +303,19 @@ function _locale_import_read_po($file) { $context = "COMMENT"; } else { // Parse error - drupal_set_message(t("Translation file %filename broken: expected 'msgstr' in line %line.", array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains an error: "msgstr" was expected but not found on line %line.', array('%filename' => $message, '%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 %filename broken: unexpected 'msgid_plural' in line %line.", array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains an error: "msgid_plural" was expected but not found on line %line.', array('%filename' => $message, '%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 %filename broken: syntax error in line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } $current["msgid"] = $current["msgid"] ."\0". $quoted; @@ -328,13 +327,13 @@ function _locale_import_read_po($file) { $current = array(); } elseif ($context == "MSGID") { // Already in this context? Parse error - drupal_set_message(t("Translation file %filename broken: unexpected 'msgid' in line %line.", array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains an error: "msgid" is unexpected on line %line.', array('%filename' => $message, '%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 %filename broken: syntax error in line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } $current["msgid"] = $quoted; @@ -342,11 +341,11 @@ function _locale_import_read_po($file) { } 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 %filename broken: unexpected 'msgstr[]' in line %line.", array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains an error: "msgstr[]" is unexpected on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } if (strpos($line, "]") === false) { - drupal_set_message(t('Translation file %filename broken: syntax error in line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } $frombracket = strstr($line, "["); @@ -354,7 +353,7 @@ function _locale_import_read_po($file) { $line = trim(strstr($line, " ")); $quoted = _locale_import_parse_quoted($line); if ($quoted === false) { - drupal_set_message(t('Translation file %filename broken: syntax error in line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } $current["msgstr"][$plural] = $quoted; @@ -362,13 +361,13 @@ function _locale_import_read_po($file) { } elseif (!strncmp("msgstr", $line, 6)) { if ($context != "MSGID") { // Should come just after a msgid block - drupal_set_message(t("Translation file %filename broken: unexpected 'msgstr' in line %line.", array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains an error: "msgstr" is unexpected on line %line.', array('%filename' => $message, '%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 %filename broken: syntax error in line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } $current["msgstr"] = $quoted; @@ -377,7 +376,7 @@ function _locale_import_read_po($file) { elseif ($line != "") { $quoted = _locale_import_parse_quoted($line); if ($quoted === false) { - drupal_set_message(t('Translation file %filename broken: syntax error in line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains a syntax error on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } if (($context == "MSGID") || ($context == "MSGID_PLURAL")) { @@ -390,7 +389,7 @@ function _locale_import_read_po($file) { $current["msgstr"][$plural] .= $quoted; } else { - drupal_set_message(t('Translation file %filename broken: unexpected string in line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename contains an error: there is an unexpected string on line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } } @@ -401,7 +400,7 @@ function _locale_import_read_po($file) { $strings[$current["msgid"]] = $current; } elseif ($context != "COMMENT") { - drupal_set_message(t('Translation file %filename broken: unexpected end of file at line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); + drupal_set_message(t('The translation file %filename ended unexpectedly at line %line.', array('%filename' => $message, '%line' => $lineno)), 'error'); return FALSE; } @@ -466,7 +465,7 @@ function _locale_import_parse_plural_for return array($nplurals, $plural); } else { - drupal_set_message(t("Translation file %filename broken: plural formula couldn't get parsed.", array('%filename' => theme('placeholder', $filename))), 'error'); + drupal_set_message(t('The translation file %filename contains an error: the plural formula could not be parsed.', array('%filename' => theme('placeholder', $filename))), 'error'); return FALSE; } } @@ -905,7 +904,7 @@ function _locale_string_delete($lid) { db_query('DELETE FROM {locales_source} WHERE lid = %d', $lid); db_query('DELETE FROM {locales_target} WHERE lid = %d', $lid); locale_refresh_cache(); - drupal_set_message(t('Deleted string')); + drupal_set_message(t('The string has been removed.')); } /** @@ -932,7 +931,7 @@ function _locale_string_save($lid) { // delete form data so it will remember where it came from $edit = ''; - drupal_set_message(t('Saved string')); + drupal_set_message(t('The string has been saved.')); } /** Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.230 diff -u -F^f -r1.230 theme.inc --- includes/theme.inc 24 Apr 2005 16:22:30 -0000 1.230 +++ includes/theme.inc 25 Apr 2005 01:24:24 -0000 @@ -793,19 +793,8 @@ function theme_item_list($items = array( } /** - * Return a themed error message. - * REMOVE: this function is deprecated an no longer used in core. - * - * @param $message - * The error message to be themed. - * - * @return - * A string containing the error output. + * Returns code that emits the 'more help'-link. */ -function theme_error($message) { - return '
'. $message .'
'; -} - function theme_more_help_link($url) { return ''; } Index: modules/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator.module,v retrieving revision 1.235 diff -u -F^f -r1.235 aggregator.module --- modules/aggregator.module 24 Apr 2005 16:34:32 -0000 1.235 +++ modules/aggregator.module 25 Apr 2005 01:24:25 -0000 @@ -265,7 +265,7 @@ function aggregator_remove($feed) { } db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $feed['fid']); db_query("UPDATE {aggregator_feed} SET checked = 0, etag = '', modified = 0 WHERE fid = %d", $feed['fid']); - drupal_set_message(t('Removed news items from %site.', array('%site' => theme('placeholder', $feed['title'])))); + drupal_set_message(t('The news items from %site have been removed.', array('%site' => theme('placeholder', $feed['title'])))); } /** @@ -345,7 +345,7 @@ function aggregator_refresh($feed) { switch ($result->code) { case 304: db_query('UPDATE {aggregator_feed} SET checked = %d WHERE fid = %d', time(), $feed['fid']); - drupal_set_message(t('No new syndicated content from %site.', array('%site' => theme('placeholder', $feed['title'])))); + drupal_set_message(t('There is no new syndicated content from %site.', array('%site' => theme('placeholder', $feed['title'])))); break; case 301: $feed['url'] = $result->redirect_url; @@ -397,15 +397,13 @@ function aggregator_refresh($feed) { cache_clear_all(); - $message = t('Syndicated content from %site.', array('%site' => theme('placeholder', $feed[title]))); - watchdog('aggregator', $message); - drupal_set_message($message); + watchdog('aggregator', t('There is new syndicated content from %site.', array('%site' => theme('placeholder', $feed[title])))); + drupal_set_message(t('There is new syndicated content from %site.', array('%site' => theme('placeholder', $feed[title])))); } break; default: - $message = t('Failed to parse RSS feed %site: %error.', array('%site' => theme('placeholder', $feed['title']), '%error' => theme('placeholder', $result->code .' '. $result->error))); - watchdog('aggregator', $message, WATCHDOG_WARNING); - drupal_set_message($message); + watchdog('aggregator', t('The RSS-feed from %site seems to be broken, due to "%error".', array('%site' => theme('placeholder', $feed['title']), '%error' => theme('placeholder', $result->code .' '. $result->error))), WATCHDOG_WARNING); + drupal_set_message(t('The RSS-feed from %site seems to be broken, because of error "%error".', array('%site' => theme('placeholder', $feed['title']), '%error' => theme('placeholder', $result->code .' '. $result->error)))); } } @@ -461,9 +459,8 @@ function aggregator_parse_feed(&$data, $ xml_set_character_data_handler($xml_parser, 'aggregator_element_data'); if (!xml_parse($xml_parser, $data, 1)) { - $message = t('Failed to parse RSS feed %site: %error at line %line.', array('%site' => theme('placeholder', $feed['title']), '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))); - watchdog('aggregator', $message, WATCHDOG_WARNING); - drupal_set_message($message, 'error'); + watchdog('aggregator', t('The RSS-feed from %site seems to be broken, due to an error "%error" on line %line.', array('%site' => theme('placeholder', $feed['title']), '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))), WATCHDOG_WARNING); + drupal_set_message(t('The RSS-feed from %site seems to be broken, because of error "%error" on line %line.', array('%site' => theme('placeholder', $feed['title']), '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))), 'error'); return 0; } xml_parser_free($xml_parser); @@ -550,7 +547,7 @@ function aggregator_parse_feed(&$data, $ } if (!valid_input_data($item['DESCRIPTION'])) { - drupal_set_message(t('Failed to parse entry from %site feed: suspicious input data.', array('%site' => theme('placeholder', $feed['title']))), 'error'); + drupal_set_message(t('The RSS feed from %site seems to be broken, because of suspicious input data.', array('%site' => theme('placeholder', $feed['title']))), 'error'); } else { aggregator_save_item(array('iid' => $entry->iid, 'fid' => $feed['fid'], 'timestamp' => $timestamp, 'title' => $title, 'link' => $link, 'author' => $item['AUTHOR'], 'description' => $item['DESCRIPTION'])); @@ -780,7 +777,7 @@ function aggregator_admin_edit_category( // Fall through: case t('Submit'): aggregator_save_category($edit); - drupal_set_message($edit['title'] ? t('The category has been updated.') : t('The category has been deleted.')); + drupal_set_message($edit['title'] ? t('The category has been updated.') : t('The category has been removed.')); menu_rebuild(); drupal_goto('admin/aggregator'); break; @@ -810,7 +807,7 @@ function aggregator_admin_edit_feed($fee // Fall through: case t('Submit'): aggregator_save_feed($edit); - drupal_set_message($edit['title'] ? t('The feed has been updated.') : t('The feed has been deleted.')); + drupal_set_message($edit['title'] ? t('The feed has been updated.') : t('The feed has been removed.')); menu_rebuild(); drupal_goto('admin/aggregator'); break; Index: modules/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block.module,v retrieving revision 1.165 diff -u -F^f -r1.165 block.module --- modules/block.module 24 Apr 2005 16:34:32 -0000 1.165 +++ modules/block.module 25 Apr 2005 01:24:25 -0000 @@ -116,8 +116,6 @@ function block_admin_save($edit) { $block['region'], $block['status'], $block['weight'], $block['throttle'], $module, $delta); } } - - return t('The block settings have been updated.'); } /** @@ -313,7 +311,7 @@ function block_box_add() { switch ($op) { case t('Save block'): if (block_box_save($edit)) { - drupal_set_message(t('The new block has been added.')); + drupal_set_message(t('The block has been created.')); drupal_goto('admin/block'); } // deliberate no break @@ -336,7 +334,7 @@ function block_box_delete($bid = 0) { if ($_POST['edit']['confirm']) { db_query('DELETE FROM {boxes} WHERE bid = %d', $bid); - drupal_set_message(t('The block %name has been deleted.', array('%name' => theme('placeholder', $info)))); + drupal_set_message(t('The block %name has been removed.', array('%name' => theme('placeholder', $info)))); cache_clear_all(); drupal_goto('admin/block'); } @@ -386,7 +384,8 @@ function block_admin() { $op = $_POST['op']; if ($op == t('Save blocks')) { - drupal_set_message(block_admin_save($edit)); + block_admin_save($edit); + drupal_set_message(t('The blocks have been saved.')); cache_clear_all(); drupal_goto($_GET['q']); } Index: modules/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book.module,v retrieving revision 1.293 diff -u -F^f -r1.293 book.module --- modules/book.module 24 Apr 2005 20:57:38 -0000 1.293 +++ modules/book.module 25 Apr 2005 01:24:26 -0000 @@ -1,5 +1,5 @@ nid, $edit['parent'], $edit['weight']); - drupal_set_message(t('Added the post to the book.')); + drupal_set_message(t('The post has been added to the book.')); drupal_goto("node/$node->nid"); break; case t('Update book outline'): db_query('UPDATE {book} SET parent = %d, weight = %d WHERE nid = %d', $edit['parent'], $edit['weight'], $node->nid); - drupal_set_message(t('Updated the book outline.')); + drupal_set_message(t('The book outline has been updated.')); drupal_goto("node/$node->nid"); break; case t('Remove from book outline'): db_query('DELETE FROM {book} WHERE nid = %d', $node->nid); - drupal_set_message(t('Removed the post from the book.')); + drupal_set_message(t('The post has been removed from the book.')); drupal_goto("node/$node->nid"); break; @@ -433,7 +433,7 @@ function book_nodeapi(&$node, $op, $teas $book = db_fetch_array(db_query('SELECT * FROM {book} WHERE nid = %d', $node->nid)); if ($book) { if ($node->moderate && user_access('administer nodes')) { - drupal_set_message(t("This update/post awaits moderation and won't be accessible until approved.")); + drupal_set_message(t("The post has been submitted for moderation and won't be accessible until it has been approved.")); } foreach ($book as $key => $value) { @@ -691,8 +691,6 @@ function book_admin_view_line($node, $de function book_admin_view_book($nid, $depth = 1) { $result = db_query(db_rewrite_sql('SELECT n.nid FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = %d ORDER BY b.weight, n.title'), $nid); - $rows = array(); - while ($node = db_fetch_object($result)) { $node = node_load(array('nid' => $node->nid)); $rows[] = book_admin_view_line($node, $depth); @@ -740,7 +738,7 @@ function book_admin_save($nid, $edit = a } } - $message = t('Updated book %title.', array('%title' => theme('placeholder', $book->title))); + $message = t('The book %title has been updated.', array('%title' => theme('placeholder', $book->title))); watchdog('content', $message); return $message; Index: modules/contact.module =================================================================== RCS file: /cvs/drupal/drupal/modules/contact.module,v retrieving revision 1.12 diff -u -F^f -r1.12 contact.module --- modules/contact.module 24 Apr 2005 16:34:33 -0000 1.12 +++ modules/contact.module 25 Apr 2005 01:24:26 -0000 @@ -135,7 +135,7 @@ function contact_mail_user() { watchdog('mail', t('%name-from sent %name-to an e-mail.', array('%name-from' => theme('placeholder', $user->name), '%name-to' => theme('placeholder', $account->name)))); // Set a status message: - drupal_set_message(t('Your message has been sent.')); + drupal_set_message(t('The message has been sent.')); // Jump to the user's profile page: drupal_goto("user/$account->uid"); Index: modules/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter.module,v retrieving revision 1.60 diff -u -F^f -r1.60 filter.module --- modules/filter.module 24 Apr 2005 16:34:33 -0000 1.60 +++ modules/filter.module 25 Apr 2005 01:24:27 -0000 @@ -325,7 +325,7 @@ function filter_admin_save() { $name = trim($name); if (strlen($name) == 0) { - drupal_set_message(t('You must enter a name for this input format.')); + drupal_set_message(t('The input format name must be specified.')); drupal_goto('admin/filters'); } else { @@ -358,14 +358,14 @@ function filter_admin_add() { $name = trim($edit['name']); if (strlen($name) == 0) { - drupal_set_message(t('You must enter a name for this input format.')); + drupal_set_message(t('The input format must have a name.')); drupal_goto('admin/filters'); } else { db_query("INSERT INTO {filter_formats} (name) VALUES ('%s')", $name); } - drupal_set_message(t('Added input format %format.', array('%format' => theme('placeholder', $edit['name'])))); + drupal_set_message(t('Input format %format has been created.', array('%format' => theme('placeholder', $edit['name'])))); drupal_goto('admin/filters'); } @@ -386,7 +386,7 @@ function filter_admin_delete() { cache_clear_all('filter:'. $edit['format'], true); - drupal_set_message(t('Deleted input format %format.', array('%format' => theme('placeholder', $edit['name'])))); + drupal_set_message(t('Input format %format has been removed.', array('%format' => theme('placeholder', $edit['name'])))); } drupal_goto('admin/filters'); } @@ -516,7 +516,7 @@ function filter_admin_order_save($format list($module, $delta) = explode('/', $id); db_query("UPDATE {filters} SET weight = %d WHERE format = %d AND module = '%s' AND delta = %d", $weight, $format, $module, $delta); } - drupal_set_message(t('The filter weights have been saved.')); + drupal_set_message(t('The filter ordering has been saved.')); cache_clear_all('filter:'. $format, true); Index: modules/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale.module,v retrieving revision 1.121 diff -u -F^f -r1.121 locale.module --- modules/locale.module 24 Apr 2005 16:34:34 -0000 1.121 +++ modules/locale.module 25 Apr 2005 01:24:27 -0000 @@ -3,11 +3,11 @@ /** * @file - * Enables administrators to manage the site interface languages. + * Enables administrators to manage their site's interface languages. * - * When enabled, the site interface can be displayed in different - * languages. The setup of languages and translations is completely - * we based. Gettext portable object files are supported. + * When enabled, this module permits the site's interface language to + * be selected. The setup of languages and translations is completely + * web based. Gettext portable object (.po) files are supported. */ // --------------------------------------------------------------------------------- @@ -22,22 +22,22 @@ function locale_help($section = "admin/h return t('Enables the translation of the user interface to languages other than English.'); case 'admin/locale': case 'admin/locale/language/overview': - return t("

Drupal allows you to translate the interface to a language other than English. This page provides an overview of the installed languages. You can add more languages on the add language page, or directly by importing a translation. If there are multiple languages enabled, registered users will be able to set their preference. The site default will be used for users without their own settings, including anonymous visitors.

There are different approaches to translate the Drupal interface: either by importing an existing translation, by translating everything yourself, or by using a combination of these.

", array("%search" => url("admin/locale/string/search"), "%import" => url("admin/locale/language/import"), "%add-language" => url("admin/locale/language/add"))); + return t("

Drupal provides support for the translation of its interface text into different languages. This page provides an overview of the installed languages. You can add a language on the add language page, or directly by importing a translation. If multiple languages are enabled, registered users will be able to set their preferred language. The site default will be used for anonymous visitors and for users without their own settings.

Drupal interface translations may be added or extended by several courses: by importing an existing translation, by translating everything from scratch, or by a combination of these approaches.

", array("%search" => url("admin/locale/string/search"), "%import" => url("admin/locale/language/import"), "%add-language" => url("admin/locale/language/add"))); case 'admin/locale/language/add': - return t("

You need to add all languages you would like to provide the site interface in. If you can't find the desired language in the quick add dropdown, then need to provide the proper language code yourself. The language code might be used to negotiate with browsers and present flags, so it is important to pick one that is standardised for the desired language. You can also add languages by importing translations directly into a language not yet set up.

", array("%import" => url("admin/locale/language/import"))); + return t("

You need to add all languages in which you would like to display the site interface. If you can't find the desired language in the quick-add dropdown, then you will need to provide the proper language code yourself. The language code may be used to negotiate with browsers and to present flags, etc., so it is important to pick a code that is standardised for the desired language. You can also add a language by importing a translation.

", array("%import" => url("admin/locale/language/import"))); case 'admin/locale/language/import': - return t("

This page allows you to import a translation provided in the gettext Portable Object (.po) format. The easiest way to get your site translated is to grab an existing Drupal translation and to import it. You can obtain translations from the Drupal translation page. Note that importing a translation file might take a while.

", array('%url' => 'http://drupal.org/project/translations')); + return t("

This page allows you to import a translation provided in the gettext Portable Object (.po) format. The easiest way to get your site translated is to obtain an existing Drupal translation and to import it. You can find existing translations on the Drupal translation page. Note that importing a translation file might take a while.

", array('%url' => 'http://drupal.org/project/translations')); case 'admin/locale/language/export': - return t("

This page allows you to export Drupal strings. The first option is to export a translation so it can be shared. The second option is to generate a translation template, which contains all Drupal strings, but without their translations. You can use this template to start a new translation using a specialized desktop application.

"); + return t("

This page allows you to export Drupal strings. The first option is to export a translation so it can be shared. The second option generates a translation template, which contains all Drupal strings, but without their translations. You can use this template to start a new translation using various software packages designed for this task.

"); case 'admin/locale/string/search': - return t("

It is often more convenient to get the strings of your setup on the export page, and start with a desktop Gettext translation editor though. Here you can search in the translated and untranslated strings, and the default English texts provided by Drupal.

", array("%export" => url("admin/locale/language/export"))); + return t("

It is often convenient to get the strings from your setup on the export page, and use a desktop Gettext translation editor to edit the translations. On this page you can search in the translated and untranslated strings, and the default English texts provided by Drupal.

", array("%export" => url("admin/locale/language/export"))); case 'admin/help#locale': return t(" -

Most programs are written and documented in English, and primarily use English to interact with users. This is also true for a great deal of web sites. However, most people are less comfortable with English than with their native language, and would prefer to use their mother tongue as much as possible. Many people love to see their web site showing a lot less English, and far more of their own language. Therefore Drupal provides a framework to setup a multi-lingual web site, or to overwrite the default English texts.

-

How to interface translation works

+

Most programs are written and documented in English, and primarily use English to interact with users. This is also true for a great deal of web sites. However, many users are less comfortable with English than with their native language, and would prefer to use their mother tongue where possible. Therefore Drupal provides a framework to setup a multi-lingual web site, or to overwrite the default English texts.

+

How interface translation works

Whenever Drupal encounters an interface string which needs to be displayed, it tries to translate it into the currently selected language. If a translation is not available, then the string is remembered, so you can look up untranslated strings easily.

-

Drupal provides two options to translate these strings. First is the integrated web interface, where you can search for untranslated strings, and specify their translations via simple web forms. An easier, and much less time consuming method is to import translations already done for your language. This is achieved by the use of GNU gettext Portable Object files. These are editable with quite convenient desktop editors specifically architected for supporting your work with GNU Gettext files. The import feature allows you to add strings from such files into the site database. The export functionality enables you to share your translations with others, generating Portable Object files from your site strings."); +

Drupal provides two options to translate these strings. The first option is an integrated web interface, where you can search for untranslated strings, and provide translations for these via simple web forms. An easier and faster method is to import translations already done for your language. This is achieved by the use of GNU gettext Portable Object files. These are editable with desktop editing tools designed for this purpose. Drupal's import feature allows you to add strings from such files into the site database. The export functionality enables you to share your translations with others, generating Portable Object files from your site strings."); break; } } @@ -300,7 +300,7 @@ function locale_admin_manage_delete_scre if (isset($languages['name'][$edit['langcode']])) { db_query("DELETE FROM {locales_meta} WHERE locale = '%s'", $edit['langcode']); db_query("DELETE FROM {locales_target} WHERE locale = '%s'", $edit['langcode']); - $message = t('%locale language removed.', array('%locale' => theme('placeholder', t($languages['name'][$edit['langcode']])))); + $message = t('The language %locale has been removed.', array('%locale' => theme('placeholder', t($languages['name'][$edit['langcode']])))); drupal_set_message($message); watchdog('locale', $message); } @@ -357,10 +357,10 @@ function locale_admin_manage_add() { } // Seems like we have not received some data - drupal_set_message(t('You need to specify both the language code and the English name of the new language.'), 'error'); + drupal_set_message(t('The language code and the English name of the new language must be specified.'), 'error'); } else { - drupal_set_message(t('The language %language (%code) is already set up.', array('%language' => ''. check_plain($edit['langname']) .'', '%code' => theme('placeholder', $edit['langcode']))), 'error'); + drupal_set_message(t('The language %language (%code) already exists.', array('%language' => theme('placeholder', check_plain($edit['langname'])), '%code' => theme('placeholder', $edit['langcode']))), 'error'); } break; } @@ -389,7 +389,7 @@ function locale_admin_import() { // Now import strings into the language $file = file_check_upload('file'); if ($ret = _locale_import_po($file, $edit['langcode'], $edit['mode']) == FALSE) { - $message = t('Translation import of %filename failed.', array('%filename' => theme('placeholder', $file->filename))); + $message = t('The translation import of %filename failed.', array('%filename' => theme('placeholder', $file->filename))); drupal_set_message($message, 'error'); watchdog('locale', $message, WATCHDOG_ERROR); } Index: modules/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu.module,v retrieving revision 1.30 diff -u -F^f -r1.30 menu.module --- modules/menu.module 24 Apr 2005 16:34:34 -0000 1.30 +++ modules/menu.module 25 Apr 2005 01:24:27 -0000 @@ -115,7 +115,7 @@ function menu_reset() { switch ($op) { case t('Reset all'): db_query('DELETE FROM {menu}'); - drupal_set_message(t('All menu items reset.')); + drupal_set_message(t('The menu items have been reset to their default settings.')); drupal_goto('admin/menu'); break; default: @@ -161,7 +161,7 @@ function menu_reset_item($mid) { switch ($op) { case t('Reset'): db_query('DELETE FROM {menu} WHERE mid = %d', $mid); - drupal_set_message(t('Menu item reset.')); + drupal_set_message(t("The menu item was reset to its default settings.")); drupal_goto('admin/menu'); break; default: @@ -189,10 +189,10 @@ function menu_delete_item($mid) { case t('Delete'): db_query('DELETE FROM {menu} WHERE mid = %d', $mid); if ($menu->type & MENU_IS_ROOT) { - drupal_set_message(t('Menu deleted.')); + drupal_set_message(t('The menu has been removed.')); } else { - drupal_set_message(t('Menu item deleted.')); + drupal_set_message(t('The menu item has been removed.')); } drupal_goto('admin/menu'); break; @@ -218,7 +218,7 @@ function menu_disable_item($mid) { $type &= ~MENU_VISIBLE_IN_BREADCRUMB; $type |= MENU_MODIFIED_BY_ADMIN; db_query('UPDATE {menu} SET type = %d WHERE mid = %d', $type, $mid); - drupal_set_message(t('Menu item disabled.')); + drupal_set_message(t('The menu item has been disabled.')); drupal_goto('admin/menu'); } @@ -348,12 +348,12 @@ function menu_edit_item_save($edit) { if ($edit['mid']) { db_query("UPDATE {menu} SET pid = %d, path = '%s', title = '%s', description = '%s', weight = %d, type = %d WHERE mid = %d", $edit['pid'], $edit['path'], $edit['title'], $edit['description'], $edit['weight'], $edit['type'] | MENU_MODIFIED_BY_ADMIN, $edit['mid']); - drupal_set_message(t('Updated menu item %title.', array('%title' => theme('placeholder', $edit['title'])))); + drupal_set_message(t('The menu item %title has been updated.', array('%title' => theme('placeholder', $edit['title'])))); } else { $mid = db_next_id('{menu}_mid'); db_query("INSERT INTO {menu} (mid, pid, path, title, description, weight, type) VALUES (%d, %d, '%s', '%s', '%s', %d, %d)", $mid, $edit['pid'], $edit['path'], $edit['title'], $edit['description'], $edit['weight'], $edit['type'] | MENU_MODIFIED_BY_ADMIN); - drupal_set_message(t('Created new menu item %title.', array('%title' => theme('placeholder', $edit['title'])))); + drupal_set_message(t('The menu item %title has been created.', array('%title' => theme('placeholder', $edit['title'])))); if (array_key_exists($edit['path'], $menu['path index'])) { $old_mid = $menu['path index'][$edit['path']]; $old_item = $menu['items'][$old_mid]; Index: modules/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload.module,v retrieving revision 1.32 diff -u -F^f -r1.32 upload.module --- modules/upload.module 24 Apr 2005 16:34:36 -0000 1.32 +++ modules/upload.module 25 Apr 2005 01:24:28 -0000 @@ -169,7 +169,7 @@ function upload_nodeapi(&$node, $op, $ar $total_usersize = upload_count_size($user->uid) + $filesize; if ($maxsize && $total_size > $maxsize) { - form_set_error('upload', t('Error attaching file %name: total file size exceeded', array('%name' => theme('placeholder', $file->filename)))); + form_set_error('upload', t('The selected file %name can not be attached to this post, because it exceeded the maximum filesize of %max-size', array('%name' => theme('placeholder', $file->filename), '%max-size' => theme('placeholder', format_size($maxsize))))); break; } @@ -207,13 +207,13 @@ function upload_nodeapi(&$node, $op, $ar } if ($error['extension'] == count($user->roles) && $user->uid != 1) { - form_set_error('upload', t('Error attaching file %name: invalid extension', array('%name' => theme('placeholder', $file->filename)))); + form_set_error('upload', t('The selected file %name can not be attached to this post, because it is only possible to attach files with the following extensions: %files-allowed', array('%files-allowed' => theme('placeholder', $extensions)))); } elseif ($error['uploadsize'] == count($user->roles) && $user->uid != 1) { - form_set_error('upload', t('Error attaching file %name: exceeds maximum file size', array('%name' => theme('placeholder', $file->filename)))); + form_set_error('upload', t('The selected file %name can not be attached to this post, because it exceeded the maximum filesize of %maxsize', array('%name' => theme('placeholder', $file->filename), '%maxsize' => theme('placeholder', format_size($uploadsize))))); } elseif ($error['usersize'] == count($user->roles) && $user->uid != 1) { - form_set_error('upload', t('Error attaching file %name: exceeds maximum file size', array('%name' => theme('placeholder', $file->filename)))); + form_set_error('upload', t('The selected file %name can not be attached to this post, because the disk quota of %quota has been reached', array('%name' => theme('placeholder', $file->filename), '%quote' => theme('placeholder', format_size($usersize))))); } else { $key = 'upload_'. count($_SESSION['file_uploads']); @@ -412,7 +412,7 @@ function _upload_image($file) { $result = image_scale($file->filepath, $file->filepath, $width, $height); if ($result) { $file->filesize = filesize($file->filepath); - drupal_set_message(t('Your image was resized to fit within the maximum allowed resolution of %resolution pixels.', array('%resolution' => variable_get('upload_max_resolution', 0)))); + drupal_set_message(t('The image was resized to fit within the maximum allowed resolution of %resolution pixels.', array('%resolution' => theme('placeholder', variable_get('upload_max_resolution', 0))))); } } }