Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.174.2.13 diff -u -p -r1.174.2.13 locale.inc --- includes/locale.inc 28 May 2010 13:07:27 -0000 1.174.2.13 +++ includes/locale.inc 7 Jul 2010 16:26:24 -0000 @@ -1308,7 +1308,7 @@ function _locale_import_one_string($op, else { // Some real string to import. - $comments = _locale_import_shorten_comments(empty($value['#']) ? array() : $value['#']); + $location = _locale_import_get_reference(empty($value['#']) ? array() : $value['#']); if (strpos($value['msgid'], "\0")) { // This string has plural versions. @@ -1323,7 +1323,7 @@ function _locale_import_one_string($op, if ($key == 0) { $plid = 0; } - $plid = _locale_import_one_string_db($report, $lang, $english[$key], $trans, $group, $comments, $mode, $plid, $key); + $plid = _locale_import_one_string_db($report, $lang, $english[$key], $trans, $group, $location, $mode, $plid, $key); } } @@ -1331,7 +1331,7 @@ function _locale_import_one_string($op, // A simple string to import. $english = $value['msgid']; $translation = $value['msgstr']; - _locale_import_one_string_db($report, $lang, $english, $translation, $group, $comments, $mode); + _locale_import_one_string_db($report, $lang, $english, $translation, $group, $location, $mode); } } } // end of db-store operation @@ -1676,6 +1676,25 @@ function _locale_import_shorten_comments } /** + * Iterate through the passed comment array looking for a reference + * + * @param $comment + * An array of strings containing a comment + * @return + * The first comment formatted as a reference, or an empty string + */ +function _locale_import_get_reference($comment) { + foreach ($comment as $str) { + // is this line a reference? + if (substr($str,0,2) == ': ') { + return substr($str,2); + } + } + // to get here there cannot have been a reference in the array + return ''; +} + +/** * Parses a string in quotes * * @param $string