r113124 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113123‎ | r113124 | r113125 >
Date:10:20, 6 March 2012
Author:santhosh
Status:ok (Comments)
Tags:i18nreview 
Comment:
Use priorityforce as a parameter to show languages in MessageStats.
Allow translation if the priority force is not set.
Modified paths:
  • /trunk/extensions/Translate/TranslateHooks.php (modified) (history)
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -387,14 +387,10 @@
388388
389389 $groupId = $handle->getGroup()->getId();
390390 $priorityForce = TranslateMetadata::get( $groupId, 'priorityforce' );
391 - if ( !$priorityForce ) {
392 - return true;
393 - }
394 -
395391 $priorityLangs = TranslateMetadata::get( $groupId, 'prioritylangs' );
396392 $priorityReason = TranslateMetadata::get( $groupId, 'priorityreason' );
397393 $filter = array_flip( explode( ',', $priorityLangs ) );
398 - if ( !isset( $filter[$handle->getCode()] ) ) {
 394+ if ( !isset( $filter[$handle->getCode()] ) && $priorityForce === 'on' ) {
399395 $result = array( 'tpt-translation-restricted', $priorityReason );
400396 return false;
401397 }
Index: trunk/extensions/Translate/TranslateHooks.php
@@ -404,7 +404,8 @@
405405 /// Hook: Translate:MessageGroupStats:isIncluded
406406 public static function hideRestrictedFromStats( $id, $code ) {
407407 $filterLangs = TranslateMetadata::get( $id, 'prioritylangs' );
408 - if ( strlen( $filterLangs ) === 0 ) {
 408+ $priorityForce = TranslateMetadata::get( $id, 'priorityforce' );
 409+ if ( strlen( $filterLangs ) === 0 || $priorityForce === 'off' ) {
409410 // No restrictions, keep everything
410411 return true;
411412 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r113141Correct the filtering of languages for MessageGroup stats. It should only lis...santhosh14:36, 6 March 2012
r113921Pedantic, r113124nikerabbit15:10, 15 March 2012

Comments

#Comment by Siebrand (talk | contribs)   14:02, 6 March 2012

Filtering does not work correctly.

Status & tagging log