r45158 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45157‎ | r45158 | r45159 >
Date:18:36, 29 December 2008
Author:raymond
Status:resolved (Comments)
Tags:
Comment:
* Add a new message for an ellipsis
* Use this message for MWSearch
Modified paths:
  • /trunk/extensions/MWSearch/MWSearch_body.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messageTypes.inc (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -2709,6 +2709,7 @@
27102710 'autocomment-prefix',
27112711 'pipe-separator',
27122712 'word-separator',
 2713+ 'ellipsis-separator',
27132714 ),
27142715 'imgmulti' => array(
27152716 'imgmultipageprev',
Index: trunk/phase3/maintenance/language/messageTypes.inc
@@ -328,6 +328,7 @@
329329 'colon-separator',
330330 'pipe-separator',
331331 'word-separator',
 332+ 'ellipsis-separator',
332333 'autocomment-prefix',
333334 'listgrouprights-right-display',
334335 'timezone-utc',
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -3575,6 +3575,7 @@
35763576 'autocomment-prefix' => '- ', # only translate this message to other languages if you have to change it
35773577 'pipe-separator' => '|', # only translate this message to other languages if you have to change it
35783578 'word-separator' => ' ', # only translate this message to other languages if you have to change it
 3579+'ellipsis-separator' => '…', # only translate this message to other languages if you have to change it
35793580
35803581 # Multipage image navigation
35813582 'imgmultipageprev' => '← previous page',
Index: trunk/extensions/MWSearch/MWSearch_body.php
@@ -313,7 +313,8 @@
314314 $start = 0;
315315 $snippet = "";
316316 $hi = 0;
317 -
 317+ $ellipsis = wfMsg( 'ellipsis-separator' );
 318+
318319 foreach($splits as $sp){
319320 $sp = intval($sp);
320321 // highlight words!
@@ -329,8 +330,8 @@
330331 if($sp == strlen($text) && $suffix != '')
331332 $snippet .= $suffix;
332333 else if($useFinalSeparator)
333 - $snippet .= " <b>...</b> ";
334 -
 334+ $snippet .= " <b>" . $ellipsis . "</b> ";
 335+
335336 $start = $sp;
336337 }
337338 return array($snippet,$original);

Follow-up revisions

RevisionCommit summaryAuthorDate
r45250Follow-up to r45158...brion20:46, 31 December 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   20:47, 31 December 2008

Updated in r45250 to change message name to simply 'ellipsis', and use content language when pulling for content-material purpose like this.

Status & tagging log