diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c347a006469..f812dab8d18 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,9 +4,9 @@ Drupal x.x.x, xxxx-xx-xx (Development version) - added free tagging support (folksonomies). - added a site-wide contact form. - theme system: - * removed the Xtemplate theme engine. - * added the PHPTemplate theme engine. + * added the PHPTemplate theme engine and removed the Xtemplate engine. * converted the bluemarine theme from XTemplate to PHPTemplate. + * converted the pushbutton theme from XTemplate to PHPTemplate. - reworked the 'request new password' functionality. - profiles: * added a block to display author information along with posts. diff --git a/includes/file.inc b/includes/file.inc index c074b632a27..8126a772b3e 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -76,7 +76,7 @@ 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 %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(&$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 %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, $replace = FILE_EXISTS_RENAME) { // 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, $replace = FILE_EXISTS_RENAME) { $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, $replace = FILE_EXISTS_RENAME) { 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, $replace = FILE_EXISTS_RENAME) { } 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, $replace = FILE_EXISTS_RENAME) { 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 = 0, $replace = FILE_EXISTS_RENAME) { } 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 = 0, $replace = FILE_EXISTS_RENAME) { */ 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); diff --git a/includes/locale.inc b/includes/locale.inc index 1a764c6cc5b..79a3d81486b 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -23,14 +23,13 @@ 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 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, $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('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, $mode) { } } 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, $mode) { // 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_forms($pluralforms, $filename) { 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.')); } /** diff --git a/includes/theme.inc b/includes/theme.inc index 6b210c55e37..e61c606cb61 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -814,19 +814,8 @@ function theme_item_list($items = array(), $title = NULL) { } /** - * 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 '
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.
-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.
+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_screen() { 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); } diff --git a/modules/locale/locale.module b/modules/locale/locale.module index f98652cdf05..b938176dbfe 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -22,22 +22,22 @@ function locale_help($section = "admin/help#locale") { 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.
-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.
+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_screen() { 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); } diff --git a/modules/menu.module b/modules/menu.module index 7baf2332772..3cd6a58ee80 100644 --- a/modules/menu.module +++ b/modules/menu.module @@ -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]; diff --git a/modules/menu/menu.module b/modules/menu/menu.module index 7baf2332772..3cd6a58ee80 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -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]; diff --git a/modules/upload.module b/modules/upload.module index 071f91aa927..ff0c82d4449 100644 --- a/modules/upload.module +++ b/modules/upload.module @@ -169,7 +169,7 @@ function upload_nodeapi(&$node, $op, $arg) { $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, $arg) { } 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))))); } } } diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 071f91aa927..ff0c82d4449 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -169,7 +169,7 @@ function upload_nodeapi(&$node, $op, $arg) { $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, $arg) { } 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))))); } } } diff --git a/themes/pushbutton/page.tpl.php b/themes/pushbutton/page.tpl.php index ee3e692a7dd..f10f65927c1 100644 --- a/themes/pushbutton/page.tpl.php +++ b/themes/pushbutton/page.tpl.php @@ -36,7 +36,7 @@