r108660 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108659‎ | r108660 | r108661 >
Date:19:39, 11 January 2012
Author:nikerabbit
Status:ok
Tags:
Comment:
Get rid of pipe symbol in translatable page group ids.
They cause too many problems, like bug 33666
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/README (modified) (history)
  • /trunk/extensions/Translate/api/ApiGroupReview.php (modified) (history)
  • /trunk/extensions/Translate/check-blacklist.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialTranslationStats.php (modified) (history)
  • /trunk/extensions/Translate/tag/TranslatablePage.php (modified) (history)
  • /trunk/translatewiki/PageTranslationAgg.yaml (modified) (history)

Diff [purge]

Index: trunk/translatewiki/PageTranslationAgg.yaml
@@ -12,4 +12,4 @@
1313 namespace: NS_TRANSLATIONS
1414
1515 GROUPS:
16 - - page|*
 16+ - page-*
Index: trunk/extensions/Translate/check-blacklist.php
@@ -651,7 +651,7 @@
652652 ),
653653 // translatewiki.net specific
654654 array(
655 - 'group' => 'page|Translating:Intro',
 655+ 'group' => 'page-Translating:Intro',
656656 'check' => 'links',
657657 'message' => array(
658658 'Translating:Intro/intro', // Contains links that are translated
Index: trunk/extensions/Translate/MessageGroups.php
@@ -1184,6 +1184,8 @@
11851185 * @return MessageGroup|null if it doesn't exist.
11861186 */
11871187 public static function getGroup( $id ) {
 1188+ // BC with page| which is now page-
 1189+ $id = strtr( $id, '|', '-' );
11881190 self::init();
11891191
11901192 global $wgTranslateEC, $wgTranslateAC, $wgTranslateCC;
Index: trunk/extensions/Translate/tag/TranslatablePage.php
@@ -181,7 +181,7 @@
182182 * @return \string
183183 */
184184 public static function getMessageGroupIdFromTitle( Title $title ) {
185 - return 'page|' . $title->getPrefixedText();
 185+ return 'page-' . $title->getPrefixedText();
186186 }
187187
188188 /**
Index: trunk/extensions/Translate/README
@@ -29,6 +29,9 @@
3030 http://translatewiki.net/docs/Translate/html/
3131
3232 == Change log ==
 33+* 2012-01-11
 34+- Translate page group id prefix was changed from page| to page-. Some old
 35+ links need to be updated, some still work.
3336 * 2012-01-10
3437 - Translate extension no longer unconditionally suppresses edit intros
3538 - Fixed compatibility issue with logs on < MW 1.18
Index: trunk/extensions/Translate/specials/SpecialTranslationStats.php
@@ -78,7 +78,8 @@
7979 $values = array_map( 'trim', explode( ',', $opts[$t] ) );
8080 $values = array_splice( $values, 0, 4 );
8181 if ( $t === 'group' ) {
82 - $values = preg_replace( '~^page_~', 'page|', $values );
 82+ // BC for old syntax which replaced _ to | which was not allowed
 83+ $values = preg_replace( '~^page_~', 'page-', $values );
8384 }
8485 $opts[$t] = implode( ',', $values );
8586 }
Index: trunk/extensions/Translate/api/ApiGroupReview.php
@@ -97,11 +97,7 @@
9898 global $wgTranslateWorkflowStates;
9999 return array(
100100 'group' => array(
101 - /* API borks with | if defined multiple allowed values even
102 - * though we are expecting only one value, which can and will
103 - * contain | for page translation pages, which have group id
104 - * of format page|Pagename. This is fixed in 1.19 and up */
105 - ApiBase::PARAM_TYPE => 'string',//array_keys( MessageGroups::getAllGroups() ),
 101+ ApiBase::PARAM_TYPE => array_keys( MessageGroups::getAllGroups() ),
106102 ApiBase::PARAM_REQUIRED => true,
107103 ),
108104 'language' => array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r109052MFT r108608 r108660 r108792 r108815 r108816nikerabbit18:40, 16 January 2012

Status & tagging log