Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -47,6 +47,11 @@ |
48 | 48 | * (bug 14377) Add a date selector to history pages |
49 | 49 | * (bug 15007) New 'pagetitle-view-mainpage' message allows the HTML <title> of |
50 | 50 | the main page to be customized |
| 51 | +* Added $wgDisableTitleConversion to disabling the conversion for all pages on |
| 52 | + the wiki |
| 53 | +* Added 'noconvertlink' toogle that can be set per user preferences, also |
| 54 | + added 'convertlink=no|yes' on GET requests whether have the link titles |
| 55 | + being converted or not |
51 | 56 | |
52 | 57 | === Bug fixes in 1.14 === |
53 | 58 | |
Index: trunk/phase3/languages/messages/MessagesYue.php |
— | — | @@ -180,6 +180,7 @@ |
181 | 181 | 'tog-ccmeonemails' => '當我寄電郵畀其他人嗰陣寄返封副本畀我', |
182 | 182 | 'tog-diffonly' => '響差異下面唔顯示頁面內容', |
183 | 183 | 'tog-showhiddencats' => '顯示隱藏類', |
| 184 | +'tog-noconvertlink' => '唔轉連結標題', |
184 | 185 | |
185 | 186 | 'underline-always' => '全部', |
186 | 187 | 'underline-never' => '永不', |
Index: trunk/phase3/languages/messages/MessagesZh_classical.php |
— | — | @@ -109,6 +109,7 @@ |
110 | 110 | 'tog-watchlisthideown' => '不哨己文', |
111 | 111 | 'tog-watchlisthidebots' => '不哨僕文', |
112 | 112 | 'tog-showhiddencats' => '示隱類', |
| 113 | +'tog-noconvertlink' => '非轉鍵題', |
113 | 114 | |
114 | 115 | 'underline-always' => '恆', |
115 | 116 | 'underline-never' => '絕', |
Index: trunk/phase3/languages/messages/MessagesZh_hans.php |
— | — | @@ -123,6 +123,7 @@ |
124 | 124 | 'tog-ccmeonemails' => '把我发送给其他用户的邮件同时发送副本给我自己', |
125 | 125 | 'tog-diffonly' => '在比较两个修订版本差异时不显示页面内容', |
126 | 126 | 'tog-showhiddencats' => '显示隐藏分类', |
| 127 | +'tog-noconvertlink' => '不转换链接标题', |
127 | 128 | |
128 | 129 | 'underline-always' => '总是使用', |
129 | 130 | 'underline-never' => '从不使用', |
Index: trunk/phase3/languages/messages/MessagesZh_hant.php |
— | — | @@ -105,6 +105,7 @@ |
106 | 106 | 'tog-ccmeonemails' => '當我寄電子郵件給其他用戶時,也寄一份複本到我的信箱。', |
107 | 107 | 'tog-diffonly' => '在比較兩個修訂版本差異時不顯示頁面內容', |
108 | 108 | 'tog-showhiddencats' => '顯示隱藏分類', |
| 109 | +'tog-noconvertlink' => '不轉換連結標題', |
109 | 110 | |
110 | 111 | 'underline-always' => '總是使用', |
111 | 112 | 'underline-never' => '從不使用', |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -532,6 +532,7 @@ |
533 | 533 | 'tog-ccmeonemails' => 'Send me copies of e-mails I send to other users', |
534 | 534 | 'tog-diffonly' => 'Do not show page content below diffs', |
535 | 535 | 'tog-showhiddencats' => 'Show hidden categories', |
| 536 | +'tog-noconvertlink' => 'Disable titles conversion', # only translate this message to other languages if you have to change it |
536 | 537 | |
537 | 538 | 'underline-always' => 'Always', |
538 | 539 | 'underline-never' => 'Never', |
Index: trunk/phase3/languages/LanguageConverter.php |
— | — | @@ -374,8 +374,10 @@ |
375 | 375 | * @private |
376 | 376 | */ |
377 | 377 | function convertTitle($text){ |
378 | | - // check for __NOTC__ tag |
379 | | - if( !$this->mDoTitleConvert ) { |
| 378 | + global $wgDisableTitleConversion, $wgUser; |
| 379 | + |
| 380 | + // check for global param and __NOTC__ tag |
| 381 | + if( $wgDisableTitleConversion || !$this->mDoTitleConvert || $wgUser->getOption('noconvertlink') == 1 ) { |
380 | 382 | $this->mTitleDisplay = $text; |
381 | 383 | return $text; |
382 | 384 | } |
— | — | @@ -389,7 +391,8 @@ |
390 | 392 | global $wgRequest; |
391 | 393 | $isredir = $wgRequest->getText( 'redirect', 'yes' ); |
392 | 394 | $action = $wgRequest->getText( 'action' ); |
393 | | - if ( $isredir == 'no' || $action == 'edit' ) { |
| 395 | + $linkconvert = $wgRequest->getText( 'linkconvert', 'yes' ); |
| 396 | + if ( $isredir == 'no' || $action == 'edit' || $linkconvert == 'no' ) { |
394 | 397 | return $text; |
395 | 398 | } else { |
396 | 399 | $this->mTitleDisplay = $this->convert($text); |
— | — | @@ -467,11 +470,20 @@ |
468 | 471 | * @public |
469 | 472 | */ |
470 | 473 | function findVariantLink( &$link, &$nt ) { |
471 | | - global $wgDisableLangConversion; |
| 474 | + global $wgDisableLangConversion, $wgDisableTitleConversion, $wgRequest, $wgUser; |
| 475 | + $isredir = $wgRequest->getText( 'redirect', 'yes' ); |
| 476 | + $action = $wgRequest->getText( 'action' ); |
| 477 | + $linkconvert = $wgRequest->getText( 'linkconvert', 'yes' ); |
| 478 | + $disableLinkConversion = $wgDisableLangConversion || $wgDisableTitleConversion; |
472 | 479 | $linkBatch = new LinkBatch(); |
473 | 480 | |
474 | 481 | $ns=NS_MAIN; |
475 | 482 | |
| 483 | + if ( $disableLinkConversion || $isredir == 'no' || $action == 'edit' |
| 484 | + || $linkconvert == 'no' || $wgUser->getOption('noconvertlink') == 1 ) { |
| 485 | + return; |
| 486 | + } |
| 487 | + |
476 | 488 | if(is_object($nt)) |
477 | 489 | $ns = $nt->getNamespace(); |
478 | 490 | |
— | — | @@ -497,8 +509,7 @@ |
498 | 510 | foreach( $titles as $varnt ) { |
499 | 511 | if( $varnt->getArticleID() > 0 ) { |
500 | 512 | $nt = $varnt; |
501 | | - if( !$wgDisableLangConversion ) |
502 | | - $link = $v; |
| 513 | + $link = $v; |
503 | 514 | break; |
504 | 515 | } |
505 | 516 | } |
Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -52,6 +52,7 @@ |
53 | 53 | 'tog-ccmeonemails', |
54 | 54 | 'tog-diffonly', |
55 | 55 | 'tog-showhiddencats', |
| 56 | + 'tog-noconvertlink', |
56 | 57 | ), |
57 | 58 | 'underline' => array( |
58 | 59 | 'underline-always', |
Index: trunk/phase3/maintenance/language/messageTypes.inc |
— | — | @@ -163,6 +163,7 @@ |
164 | 164 | 'unit-pixel', |
165 | 165 | 'userrights-irreversible-marker', |
166 | 166 | 'tog-nolangconversion', |
| 167 | + 'tog-noconvertlink', |
167 | 168 | 'yourvariant', |
168 | 169 | 'variantname-zh-hans', |
169 | 170 | 'variantname-zh-hant', |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -861,6 +861,9 @@ |
862 | 862 | /** Whether to enable language variant conversion. */ |
863 | 863 | $wgDisableLangConversion = false; |
864 | 864 | |
| 865 | +/** Whether to enable language variant conversion for links. */ |
| 866 | +$wgDisableTitleConversion = false; |
| 867 | + |
865 | 868 | /** Default variant code, if false, the default will be the language code */ |
866 | 869 | $wgDefaultLanguageVariant = false; |
867 | 870 | |
— | — | @@ -2226,6 +2229,7 @@ |
2227 | 2230 | 'watchdefault' => 0, |
2228 | 2231 | 'watchmoves' => 0, |
2229 | 2232 | 'watchdeletion' => 0, |
| 2233 | + 'convertlink' => 0, |
2230 | 2234 | ); |
2231 | 2235 | |
2232 | 2236 | /** Whether or not to allow and use real name fields. Defaults to true. */ |
Index: trunk/phase3/includes/specials/SpecialPreferences.php |
— | — | @@ -513,7 +513,7 @@ |
514 | 514 | function mainPrefsForm( $status , $message = '' ) { |
515 | 515 | global $wgUser, $wgOut, $wgLang, $wgContLang; |
516 | 516 | global $wgAllowRealName, $wgImageLimits, $wgThumbLimits; |
517 | | - global $wgDisableLangConversion; |
| 517 | + global $wgDisableLangConversion, $wgDisableTitleConversion; |
518 | 518 | global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits; |
519 | 519 | global $wgRCShowWatchingUsers, $wgEnotifRevealEditorAddress; |
520 | 520 | global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication; |
— | — | @@ -734,6 +734,16 @@ |
735 | 735 | ) |
736 | 736 | ); |
737 | 737 | } |
| 738 | + |
| 739 | + if(count($variantArray) > 1 && !$wgDisableLangConversion && !$wgDisableTitleConversion) { |
| 740 | + $wgOut->addHtml( |
| 741 | + Xml::tags( 'tr', null, |
| 742 | + Xml::tags( 'td', array( 'colspan' => '2' ), |
| 743 | + $this->getToggle( "noconvertlink" ) |
| 744 | + ) |
| 745 | + ) |
| 746 | + ); |
| 747 | + } |
738 | 748 | } |
739 | 749 | |
740 | 750 | # Password |
Index: trunk/phase3/includes/User.php |
— | — | @@ -88,6 +88,7 @@ |
89 | 89 | 'ccmeonemails', |
90 | 90 | 'diffonly', |
91 | 91 | 'showhiddencats', |
| 92 | + 'noconvertlink', |
92 | 93 | ); |
93 | 94 | |
94 | 95 | /** |