r92224 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92223‎ | r92224 | r92225 >
Date:01:00, 15 July 2011
Author:kaldari
Status:ok
Tags:
Comment:
follow-up to r92037 - making log details more localizable
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.i18n.php (modified) (history)
  • /trunk/extensions/CentralNotice/centralnotice.css (modified) (history)
  • /trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php
@@ -200,14 +200,21 @@
201201 function showInitialSettings( $row ) {
202202 global $wgLang;
203203 $details = '';
204 - $details .= '<b>'.wfMsg ( 'centralnotice-start-date' ).':</b> '.
205 - $wgLang->date( $row->notlog_end_start ).' '.
206 - $wgLang->time( $row->notlog_end_start )."<br/>";
207 - $details .= '<b>'.wfMsg ( 'centralnotice-end-date' ).':</b> '.
208 - $wgLang->date( $row->notlog_end_end ).' '.
209 - $wgLang->time( $row->notlog_end_end )."<br/>";
210 - $details .= '<b>'.wfMsg ( 'centralnotice-projects' ).':</b> '.
211 - $row->notlog_end_projects."<br/>";
 204+ $details .= wfMsg (
 205+ 'centralnotice-log-label',
 206+ wfMsg ( 'centralnotice-start-date' ),
 207+ $wgLang->date( $row->notlog_end_start ).' '.$wgLang->time( $row->notlog_end_start )
 208+ )."<br/>";
 209+ $details .= wfMsg (
 210+ 'centralnotice-log-label',
 211+ wfMsg ( 'centralnotice-end-date' ),
 212+ $wgLang->date( $row->notlog_end_end ).' '.$wgLang->time( $row->notlog_end_end )
 213+ )."<br/>";
 214+ $details .= wfMsg (
 215+ 'centralnotice-log-label',
 216+ wfMsg ( 'centralnotice-projects' ),
 217+ $row->notlog_end_projects
 218+ )."<br/>";
212219 $language_count = count( explode ( ', ', $row->notlog_end_languages ) );
213220 $languageList = '';
214221 if ( $language_count > 15 ) {
@@ -215,11 +222,16 @@
216223 } elseif ( $language_count > 0 ) {
217224 $languageList = $row->notlog_end_languages;
218225 }
219 - $details .= '<b>'.wfMsg ( 'centralnotice-languages' ).':</b> '.
220 - $languageList."<br/>";
221 - $details .= '<b>'.wfMsg ( 'centralnotice-geo' ).':</b> ';
222 - $details .= $row->notlog_end_geo ? 'on' : 'off';
223 - $details .= "<br/>";
 226+ $details .= wfMsg (
 227+ 'centralnotice-log-label',
 228+ wfMsg ( 'centralnotice-languages' ),
 229+ $languageList
 230+ )."<br/>";
 231+ $details .= wfMsg (
 232+ 'centralnotice-log-label',
 233+ wfMsg ( 'centralnotice-geo' ),
 234+ ($row->notlog_end_geo ? 'on' : 'off')
 235+ )."<br/>";
224236 if ( $row->notlog_end_geo ) {
225237 $country_count = count( explode ( ', ', $row->notlog_end_countries ) );
226238 $countryList = '';
@@ -228,8 +240,11 @@
229241 } elseif ( $country_count > 0 ) {
230242 $countryList = $row->notlog_end_countries;
231243 }
232 - $details .= '<b>'.wfMsg ( 'centralnotice-countries' ).':</b> '.
233 - $countryList."<br/>";
 244+ $details .= wfMsg (
 245+ 'centralnotice-log-label',
 246+ wfMsg ( 'centralnotice-countries' ),
 247+ $countryList
 248+ )."<br/>";
234249 }
235250 return $details;
236251 }
@@ -238,16 +253,26 @@
239254 global $wgLang;
240255 $details = '';
241256 if ( $row->notlog_begin_start !== $row->notlog_end_start ) {
242 - $details .= '<b>'.wfMsg ( 'centralnotice-start-date' ).':</b> ';
243 - $details .= wfMsg ( 'centralnotice-changed',
244 - $wgLang->date( $row->notlog_begin_start ).' '.$wgLang->time( $row->notlog_begin_start ),
245 - $wgLang->date( $row->notlog_end_start ).' '.$wgLang->time( $row->notlog_end_start ) )."<br/>";
 257+ $details .= wfMsg (
 258+ 'centralnotice-log-label',
 259+ wfMsg ( 'centralnotice-start-date' ),
 260+ wfMsg (
 261+ 'centralnotice-changed',
 262+ $wgLang->date( $row->notlog_begin_start ).' '.$wgLang->time( $row->notlog_begin_start ),
 263+ $wgLang->date( $row->notlog_end_start ).' '.$wgLang->time( $row->notlog_end_start )
 264+ )
 265+ )."<br/>";
246266 }
247267 if ( $row->notlog_begin_end !== $row->notlog_end_end ) {
248 - $details .= '<b>'.wfMsg ( 'centralnotice-end-date' ).':</b> ';
249 - $details .= wfMsg ( 'centralnotice-changed',
250 - $wgLang->date( $row->notlog_begin_end ).' '.$wgLang->time( $row->notlog_begin_end ),
251 - $wgLang->date( $row->notlog_end_end ).' '.$wgLang->time( $row->notlog_end_end ) )."<br/>";
 268+ $details .= wfMsg (
 269+ 'centralnotice-log-label',
 270+ wfMsg ( 'centralnotice-end-date' ),
 271+ wfMsg (
 272+ 'centralnotice-changed',
 273+ $wgLang->date( $row->notlog_begin_end ).' '.$wgLang->time( $row->notlog_begin_end ),
 274+ $wgLang->date( $row->notlog_end_end ).' '.$wgLang->time( $row->notlog_end_end )
 275+ )
 276+ )."<br/>";
252277 }
253278 $details .= $this->testBooleanChange( 'enabled', $row );
254279 $details .= $this->testBooleanChange( 'preferred', $row );
@@ -268,7 +293,6 @@
269294 foreach( $endBannersObject as $key => $weight ) {
270295 $endBanners[$key] = $key.' ('.$weight.')';
271296 }
272 - $details .= '<b>'.wfMsg ( 'centralnotice-templates' ).':</b> ';
273297 if ( $beginBanners ) {
274298 $before = implode( ', ', $beginBanners );
275299 } else {
@@ -279,7 +303,11 @@
280304 } else {
281305 $after = wfMsg ( 'centralnotice-no-assignments' );
282306 }
283 - $details .= wfMsg ( 'centralnotice-changed', $before, $after) . "<br/>";
 307+ $details .= wfMsg (
 308+ 'centralnotice-log-label',
 309+ wfMsg ( 'centralnotice-templates' ),
 310+ wfMsg ( 'centralnotice-changed', $before, $after)
 311+ )."<br/>";
284312 }
285313 return $details;
286314 }
@@ -289,10 +317,15 @@
290318 $beginField = 'notlog_begin_'.$param;
291319 $endField = 'notlog_end_'.$param;
292320 if ( $row->$beginField !== $row->$endField ) {
293 - $result .= '<b>'.wfMsg ( 'centralnotice-'.$param ).':</b> ';
294 - $result .= wfMsg ( 'centralnotice-changed',
295 - ( $row->$beginField ? wfMsg ( 'centralnotice-on' ) : wfMsg ( 'centralnotice-off' ) ),
296 - ( $row->$endField ? wfMsg ( 'centralnotice-on' ) : wfMsg ( 'centralnotice-off' ) ) )."<br/>";
 321+ $result .= wfMsg (
 322+ 'centralnotice-log-label',
 323+ wfMsg ( 'centralnotice-'.$param ),
 324+ wfMsg (
 325+ 'centralnotice-changed',
 326+ ( $row->$beginField ? wfMsg ( 'centralnotice-on' ) : wfMsg ( 'centralnotice-off' ) ),
 327+ ( $row->$endField ? wfMsg ( 'centralnotice-on' ) : wfMsg ( 'centralnotice-off' ) )
 328+ )
 329+ )."<br/>";
297330 }
298331 return $result;
299332 }
@@ -312,18 +345,19 @@
313346 }
314347 $added = array_diff( $endSet, $beginSet );
315348 $removed = array_diff( $beginSet, $endSet );
316 - $result .= '<b>'.wfMsg ( 'centralnotice-'.$param ).':</b> ';
 349+ $differences = '';
317350 if ( $added ) {
318 - $result .= wfMsg ( 'centralnotice-added', implode( ', ', $added ) );
319 - if ( $removed ) {
320 - $result .= '; ';
321 - } else {
322 - $result .= '<br/>';
323 - }
 351+ $differences .= wfMsg ( 'centralnotice-added', implode( ', ', $added ) );
 352+ if ( $removed ) $differences .= '; ';
324353 }
325354 if ( $removed ) {
326 - $result .= wfMsg ( 'centralnotice-removed', implode( ', ', $removed ) ).'<br/>';
 355+ $differences .= wfMsg ( 'centralnotice-removed', implode( ', ', $removed ) );
327356 }
 357+ $result .= wfMsg (
 358+ 'centralnotice-log-label',
 359+ wfMsg ( 'centralnotice-'.$param ),
 360+ $differences
 361+ )."<br/>";
328362 }
329363 return $result;
330364 }
Index: trunk/extensions/CentralNotice/centralnotice.css
@@ -69,6 +69,9 @@
7070 #preferences .cn-old-value {
7171 color: #8B0000;
7272 }
 73+#preferences .cn-log-label {
 74+ font-weight: bold;
 75+}
7376
7477 /* Vector-specific definitions */
7578 body.skin-vector #preferences fieldset.prefsection {
Index: trunk/extensions/CentralNotice/CentralNotice.i18n.php
@@ -160,6 +160,7 @@
161161 'centralnotice-no-assignments' => 'no banners assigned',
162162 'centralnotice-talk-link' => 'talk',
163163 'centralnotice-user-links' => '$1 ($2)',
 164+ 'centralnotice-log-label' => '<span class="cn-log-label">$1:</span> $2',
164165 );
165166
166167 /** Message documentation (Message documentation)
@@ -251,6 +252,7 @@
252253 'centralnotice-no-assignments' => 'Appears in the middle of a sentence; should be all lower case.',
253254 'centralnotice-talk-link' => 'Link for user talk page; should be lower case.',
254255 'centralnotice-user-links' => '$1 is a link to the user page, $2 is a link to the user talk page.',
 256+ 'centralnotice-log-label' => '$1 is a label for a setting, $2 is the value of the setting (or changes to the setting)',
255257 );
256258
257259 /** Afrikaans (Afrikaans)

Follow-up revisions

RevisionCommit summaryAuthorDate
r92243Followup r92224/r92212: optional for Translatewikiraymond14:47, 15 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92037output campaign log detailskaldari00:30, 13 July 2011

Status & tagging log