* Added 'noconvertlink' toogle that can be set per user preferences, also added 'convertlink=no|yes' on GET requests whether have the link titles being converted or not
patches by PhiLiP
* (bug 14377) Add a date selector to history pages
* (bug 15007) New 'pagetitle-view-mainpage' message allows the HTML <title> of
the main page to be customized
+* Added $wgDisableTitleConversion to disabling the conversion for all pages on
+ the wiki
+* Added 'noconvertlink' toogle that can be set per user preferences, also
+ added 'convertlink=no|yes' on GET requests whether have the link titles
+ being converted or not
=== Bug fixes in 1.14 ===
/** Whether to enable language variant conversion. */
$wgDisableLangConversion = false;
+/** Whether to enable language variant conversion for links. */
+$wgDisableTitleConversion = false;
+
/** Default variant code, if false, the default will be the language code */
$wgDefaultLanguageVariant = false;
'watchdefault' => 0,
'watchmoves' => 0,
'watchdeletion' => 0,
+ 'convertlink' => 0,
);
/** Whether or not to allow and use real name fields. Defaults to true. */
'ccmeonemails',
'diffonly',
'showhiddencats',
+ 'noconvertlink',
);
/**
function mainPrefsForm( $status , $message = '' ) {
global $wgUser, $wgOut, $wgLang, $wgContLang;
global $wgAllowRealName, $wgImageLimits, $wgThumbLimits;
- global $wgDisableLangConversion;
+ global $wgDisableLangConversion, $wgDisableTitleConversion;
global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits;
global $wgRCShowWatchingUsers, $wgEnotifRevealEditorAddress;
global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication;
)
);
}
+
+ if(count($variantArray) > 1 && !$wgDisableLangConversion && !$wgDisableTitleConversion) {
+ $wgOut->addHtml(
+ Xml::tags( 'tr', null,
+ Xml::tags( 'td', array( 'colspan' => '2' ),
+ $this->getToggle( "noconvertlink" )
+ )
+ )
+ );
+ }
}
# Password
* @private
*/
function convertTitle($text){
- // check for __NOTC__ tag
- if( !$this->mDoTitleConvert ) {
+ global $wgDisableTitleConversion, $wgUser;
+
+ // check for global param and __NOTC__ tag
+ if( $wgDisableTitleConversion || !$this->mDoTitleConvert || $wgUser->getOption('noconvertlink') == 1 ) {
$this->mTitleDisplay = $text;
return $text;
}
global $wgRequest;
$isredir = $wgRequest->getText( 'redirect', 'yes' );
$action = $wgRequest->getText( 'action' );
- if ( $isredir == 'no' || $action == 'edit' ) {
+ $linkconvert = $wgRequest->getText( 'linkconvert', 'yes' );
+ if ( $isredir == 'no' || $action == 'edit' || $linkconvert == 'no' ) {
return $text;
} else {
$this->mTitleDisplay = $this->convert($text);
* @public
*/
function findVariantLink( &$link, &$nt ) {
- global $wgDisableLangConversion;
+ global $wgDisableLangConversion, $wgDisableTitleConversion, $wgRequest, $wgUser;
+ $isredir = $wgRequest->getText( 'redirect', 'yes' );
+ $action = $wgRequest->getText( 'action' );
+ $linkconvert = $wgRequest->getText( 'linkconvert', 'yes' );
+ $disableLinkConversion = $wgDisableLangConversion || $wgDisableTitleConversion;
$linkBatch = new LinkBatch();
$ns=NS_MAIN;
+ if ( $disableLinkConversion || $isredir == 'no' || $action == 'edit'
+ || $linkconvert == 'no' || $wgUser->getOption('noconvertlink') == 1 ) {
+ return;
+ }
+
if(is_object($nt))
$ns = $nt->getNamespace();
foreach( $titles as $varnt ) {
if( $varnt->getArticleID() > 0 ) {
$nt = $varnt;
- if( !$wgDisableLangConversion )
- $link = $v;
+ $link = $v;
break;
}
}
'tog-ccmeonemails' => 'Send me copies of e-mails I send to other users',
'tog-diffonly' => 'Do not show page content below diffs',
'tog-showhiddencats' => 'Show hidden categories',
+'tog-noconvertlink' => 'Disable titles conversion', # only translate this message to other languages if you have to change it
'underline-always' => 'Always',
'underline-never' => 'Never',
'tog-ccmeonemails' => '當我寄電郵畀其他人嗰陣寄返封副本畀我',
'tog-diffonly' => '響差異下面唔顯示頁面內容',
'tog-showhiddencats' => '顯示隱藏類',
+'tog-noconvertlink' => '唔轉連結標題',
'underline-always' => '全部',
'underline-never' => '永不',
'tog-watchlisthideown' => '不哨己文',
'tog-watchlisthidebots' => '不哨僕文',
'tog-showhiddencats' => '示隱類',
+'tog-noconvertlink' => '非轉鍵題',
'underline-always' => '恆',
'underline-never' => '絕',
'tog-ccmeonemails' => '把我发送给其他用户的邮件同时发送副本给我自己',
'tog-diffonly' => '在比较两个修订版本差异时不显示页面内容',
'tog-showhiddencats' => '显示隐藏分类',
+'tog-noconvertlink' => '不转换链接标题',
'underline-always' => '总是使用',
'underline-never' => '从不使用',
'tog-ccmeonemails' => '當我寄電子郵件給其他用戶時,也寄一份複本到我的信箱。',
'tog-diffonly' => '在比較兩個修訂版本差異時不顯示頁面內容',
'tog-showhiddencats' => '顯示隱藏分類',
+'tog-noconvertlink' => '不轉換連結標題',
'underline-always' => '總是使用',
'underline-never' => '從不使用',
'unit-pixel',
'userrights-irreversible-marker',
'tog-nolangconversion',
+ 'tog-noconvertlink',
'yourvariant',
'variantname-zh-hans',
'variantname-zh-hant',
'tog-ccmeonemails',
'tog-diffonly',
'tog-showhiddencats',
+ 'tog-noconvertlink',
),
'underline' => array(
'underline-always',