r46227 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46226‎ | r46227 | r46228 >
Date:20:44, 25 January 2009
Author:siebrand
Status:deferred
Tags:
Comment:
Add parameter to 4 messages to allow for better localisation ('smw_oi_statementsabout', 'smw_oi_mapto', 'smw_oi_thisissubcategoryof', and 'smw_oi_thishascategory')
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/OntologyImport/SMW_SpecialOntologyImport.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/OntologyImport/SMW_SpecialOntologyImport.php
@@ -188,7 +188,8 @@
189189 } else {
190190 $classnew = 'class="new" ';
191191 }
192 - $s['HUMAN'] = wfMsg( 'smw_oi_thishascategory' ) . ' <a href="'. $t->getLocalURL() .'" '. $classnew .'title="'. $t->getPrefixedText() .'">'. $t->getPrefixedText() .'</a>' . "\n";
 192+ $thishascategoryLink = '<a href="'. $t->getLocalURL() .'" '. $classnew .'title="'. $t->getPrefixedText() .'">'. $t->getPrefixedText() .'</a>';
 193+ $s['HUMAN'] = wfMsg( 'smw_oi_thishascategory', $thishascategoryLink ) . "\n";
193194 $s['WIKI'] = "[[" . $t->getPrefixedText() . "]]" . "\n";
194195 $statements[] = $s;
195196 }
@@ -222,7 +223,8 @@
223224 } else {
224225 $classnew = 'class="new" ';
225226 }
226 - $s['HUMAN'] = wfMsg( 'smw_oi_thisissubcategoryof' ) . ' <a href="'. $t->getLocalURL() .'" '. $classnew .'title="'. $t->getPrefixedText() .'">'. $t->getPrefixedText() .'</a>' . "\n";
 227+ $thisissubcategoryofLink = '<a href="'. $t->getLocalURL() .'" '. $classnew .'title="'. $t->getPrefixedText() .'">'. $t->getPrefixedText() .'</a>';
 228+ $s['HUMAN'] = wfMsg( 'smw_oi_thisissubcategoryof', $thisissubcategoryofLink ) . "\n";
227229 $s['WIKI'] = "[[" . $t->getPrefixedText() . "]]" . "\n";
228230 $statements[] = $s;
229231 }
@@ -340,12 +342,14 @@
341343
342344 // TODO $message .= '<input type="checkbox" />'; one click to click all statements about an entity
343345 wfLoadExtensionMessages('SemanticMediaWiki');
344 - $message .= wfMsg( 'smw_oi_statementsabout' ) . ' <a href="'. $t->getLocalURL() .'" '. $classnew .'title="'. $t->getPrefixedText() .'">'. $t->getPrefixedText() .'</a> <br />' . "\n";
 346+ $statementsaboutLink = ' <a href="'. $t->getLocalURL() .'" '. $classnew .'title="'. $t->getPrefixedText() .'">'. $t->getPrefixedText() .'</a> <br />';
 347+ $message .= wfMsg( 'smw_oi_statementsabout', $statementsaboutLink ) . "\n";
345348
346349 $snr = 0;
347350 if ($need_to_map) {
348351 $value = $ns . ':' . $t->getDBkey() . '::[[equivalent URI:=' . $entity->getURI() . '| ]]'; // TODO internationalize equivalent URI
349 - $message .= '&nbsp; <input type="checkbox" name="s' . $enr . '_' . $snr++ . '" value="' . $value . '" />' . wfMsg( 'smw_oi_mapto' ) . ' <em><a href="' . $entity->getURI() . '" title="' . $entity->getURI() . '">' . $entity->getURI() . '</a></em> <br />' . "\n";
 352+ $maptoLink = '<em><a href="' . $entity->getURI() . '" title="' . $entity->getURI() . '">' . $entity->getURI() . '</a></em> <br />';
 353+ $message .= '&nbsp; <input type="checkbox" name="s' . $enr . '_' . $snr++ . '" value="' . $value . '" />' . wfMsg( 'smw_oi_mapto', $maptoLink ) . "\n";
350354 }
351355
352356 foreach ($statements as $statement) {
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
@@ -171,11 +171,11 @@
172172 'smw_oi_select' => 'Select the statements to import, and then click the import button.',
173173 'smw_oi_textforall' => 'Header text to add to all imports (may be empty):',
174174 'smw_oi_selectall' => 'Select or unselect all statements',
175 - 'smw_oi_statementsabout' => 'Statements about',
176 - 'smw_oi_mapto' => 'Map entity to',
 175+ 'smw_oi_statementsabout' => 'Statements about $1',
 176+ 'smw_oi_mapto' => 'Map entity to $1',
177177 'smw_oi_comment' => 'Add the following text:',
178 - 'smw_oi_thisissubcategoryof' => 'A subcategory of',
179 - 'smw_oi_thishascategory' => 'Is part of',
 178+ 'smw_oi_thisissubcategoryof' => 'A subcategory of $1',
 179+ 'smw_oi_thishascategory' => 'Is part of $1',
180180 'smw_oi_importedfromontology' => 'Import from ontology',
181181
182182 // Messages for (data)Types Special

Status & tagging log