diff --git a/includes/gettext.inc b/includes/gettext.inc
index a3d2a7c..656a3a6 100644
--- a/includes/gettext.inc
+++ b/includes/gettext.inc
@@ -61,8 +61,8 @@ function _locale_import_po($file, $langcode, $mode) {
drupal_set_message(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => $additions, '%update' => $updates, '%delete' => $deletes)));
watchdog('locale', 'Imported %file into %locale: %number new strings added, %update updated and %delete removed.', array('%file' => $file->filename, '%locale' => $langcode, '%number' => $additions, '%update' => $updates, '%delete' => $deletes));
if ($skips) {
- $skip_message = format_plural($skips, 'One translation string was skipped because it contains disallowed HTML.', '@count translation strings were skipped because they contain disallowed HTML.');
- drupal_set_message($skip_message);
+ $skip_message = format_plural($skips, 'One translation string was skipped because it contains disallowed or malformed HTML. See the log for details on the skipped string.', '@count translation strings were skipped because they contain disallowed or malformed HTML. See the log for details on the skipped strings.');
+ drupal_set_message($skip_message, 'error');
watchdog('locale', '@count disallowed HTML string(s) in %file', array('@count' => $skips, '%file' => $file->uri), WATCHDOG_WARNING);
}
return TRUE;
@@ -481,6 +481,7 @@ function _locale_import_one_string_db(&$report, $langcode, $context, $source, $t
if (!empty($translation)) {
// Skip this string unless it passes a check for dangerous code.
if (!locale_string_is_safe($translation)) {
+ watchdog('locale', 'String "%string" was not imported due to potentially dangerous or malformed HTML in the string', array('%string' => $translation), WATCHDOG_ERROR);
$report['skips']++;
$lid = 0;
}
diff --git a/modules/locale/locale.test b/modules/locale/locale.test
index b94f565..2d539ae 100644
--- a/modules/locale/locale.test
+++ b/modules/locale/locale.test
@@ -694,7 +694,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
// The import should have created 1 string and rejected 2.
$this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 1, '%update' => 0, '%delete' => 0)), t('The translation file was successfully imported.'));
- $skip_message = format_plural(2, 'One translation string was skipped because it contains disallowed HTML.', '@count translation strings were skipped because they contain disallowed HTML.');
+ $skip_message = format_plural(2, 'One translation string was skipped because it contains disallowed or malformed HTML. See the log for details on the skipped string.', '@count translation strings were skipped because they contain disallowed or malformed HTML. See the log for details on the skipped strings.');
$this->assertRaw($skip_message, t('Unsafe strings were skipped.'));