From a38c8add84241ed1453bbb99e1c5d8b4c8c29cb8 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 15 Sep 2006 21:02:35 +0000 Subject: [PATCH] reverting SerbianVariants check-in, not ready to go live yet on Wikimedia --- includes/Article.php | 36 +---- includes/Parser.php | 100 ++----------- includes/SearchEngine.php | 15 +- includes/SpecialSearch.php | 15 -- languages/Language.php | 131 ++---------------- languages/LanguageConverter.php | 74 +++------- languages/LanguageSr.php | 45 ++---- languages/MessagesSr_ec.php | 2 +- languages/MessagesSr_el.php | 2 +- .../archives/patch-page_no_title_convert.sql | 7 - maintenance/mysql5/tables.sql | 4 - maintenance/tables.sql | 4 - maintenance/updaters.inc | 1 - 13 files changed, 57 insertions(+), 379 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index c3da94067a..f32e15e73c 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -30,8 +30,6 @@ class Article { var $mGoodAdjustment; //!< var $mLatest; //!< var $mMinorEdit; //!< - var $mNoTitleConvert; //!< - var $mNoTitleConvertParser; //!< var $mOldId; //!< var $mRedirectedFrom; //!< var $mRedirectUrl; //!< @@ -132,8 +130,6 @@ class Article { $this->mRevIdFetched = 0; $this->mRedirectUrl = false; $this->mLatest = false; - $this->mNoTitleConvert = false; - $this->mNoTitleConvertParser = false; } /** @@ -271,8 +267,7 @@ class Article { 'page_random', 'page_touched', 'page_latest', - 'page_len', - 'page_no_title_convert') ; + 'page_len' ) ; wfRunHooks( 'ArticlePageDataBefore', array( &$this , &$fields ) ) ; $row = $dbr->selectRow( 'page', $fields, @@ -308,8 +303,6 @@ class Article { * @private */ function loadPageData( $data = 'fromdb' ) { - global $wgContLang; - if ( $data === 'fromdb' ) { $dbr =& $this->getDB(); $data = $this->pageDataFromId( $dbr, $this->getId() ); @@ -327,10 +320,6 @@ class Article { $this->mTouched = wfTimestamp( TS_MW, $data->page_touched ); $this->mIsRedirect = $data->page_is_redirect; $this->mLatest = $data->page_latest; - $this->mNoTitleConvert = $data->page_no_title_convert; - - if($this->mNoTitleConvert) - $wgContLang->setNoTitleConvert(); } else { if ( is_object( $this->mTitle ) ) { $lc->addBadLinkObj( $this->mTitle ); @@ -995,7 +984,6 @@ class Article { 'page_touched' => $dbw->timestamp(), 'page_latest' => 0, # Fill this in shortly... 'page_len' => 0, # Fill this in shortly... - 'page_no_title_convert' => 0, ), __METHOD__ ); $newid = $dbw->insertId(); @@ -1035,21 +1023,12 @@ class Article { 'page_is_new' => ($lastRevision === 0) ? 1 : 0, 'page_is_redirect' => Article::isRedirect( $text ) ? 1 : 0, 'page_len' => strlen( $text ), - 'page_no_title_convert' => ($this->mNoTitleConvertParser)? 1 : 0, ), $conditions, __METHOD__ ); - $succ = $dbw->affectedRows() != 0; - - // check if no title magic word has been changed - if($succ && $this->mNoTitleConvert != $this->mNoTitleConvertParser){ - // Clear caches - Article::onArticleCreate( $this->mTitle ); - } - wfProfileOut( __METHOD__ ); - return $succ; + return ( $dbw->affectedRows() != 0 ); } /** @@ -1215,7 +1194,7 @@ class Article { * @return bool success */ function doEdit( $text, $summary, $flags = 0 ) { - global $wgUser, $wgDBtransactions, $wgContLang; + global $wgUser, $wgDBtransactions; wfProfileIn( __METHOD__ ); $good = true; @@ -1242,15 +1221,6 @@ class Article { $isminor = ( $flags & EDIT_MINOR ) && $wgUser->isAllowed('minoredit'); $bot = $wgUser->isAllowed( 'bot' ) || ( $flags & EDIT_FORCE_BOT ); - // process the notitleconvert magic for languages with variants - $this->mNoTitleConvertParser = false; - if(sizeof($wgContLang->getVariants())>1){ - $mw =& MagicWord::get( 'notitleconvert' ); - if( $mw->match( $text ) ){ - $this->mNoTitleConvertParser = true; - } - } - $text = $this->preSaveTransform( $text ); $dbw =& wfGetDB( DB_MASTER ); diff --git a/includes/Parser.php b/includes/Parser.php index 12ec5d1900..e099144154 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1507,6 +1507,7 @@ class Parser } $selflink = $this->mTitle->getPrefixedText(); + $checkVariantLink = sizeof($wgContLang->getVariants())>1; $useSubpages = $this->areSubpagesAllowed(); wfProfileOut( $fname.'-setup' ); @@ -1601,6 +1602,13 @@ class Parser continue; } + #check other language variants of the link + #if the article does not exist + if( $checkVariantLink + && $nt->getArticleID() == 0 ) { + $wgContLang->findVariantLink($link, $nt); + } + $ns = $nt->getNamespace(); $iw = $nt->getInterWiki(); wfProfileOut( "$fname-title" ); @@ -3889,7 +3897,6 @@ class Parser function replaceLinkHolders( &$text, $options = 0 ) { global $wgUser; global $wgOutputReplace; - global $wgContLang, $wgLanguageCode; $fname = 'Parser::replaceLinkHolders'; wfProfileIn( $fname ); @@ -3980,97 +3987,6 @@ class Parser } wfProfileOut( $fname.'-check' ); - # Do a second query for different language variants of links (if needed) - if($wgContLang->hasVariants()){ - $linkBatch = new LinkBatch(); - $variantMap = array(); // maps $pdbkey_Variant => $pdbkey_original - - // Add variants of links to link batch - foreach ( $this->mLinkHolders['namespaces'] as $key => $ns ) { - $title = $this->mLinkHolders['titles'][$key]; - if ( is_null( $title ) ) - continue; - - $pdbk = $title->getPrefixedDBkey(); - - // add the original text into query to check for notitleconvert pages - $variantTitle = Title::makeTitle( $ns, $title->getText() ); - $linkBatch->addObj( $variantTitle ); - $variantMap[$variantTitle->getPrefixedDBkey()][] = $key; - - // generate all variants of the link title text - $allTextVariants = $wgContLang->convertLinkToAllVariants($title->getText()); - - // if link was not found (in first query), add all variants to query - if ( !isset($colours[$pdbk]) ){ - foreach($allTextVariants as $textVariant){ - $variantTitle = Title::makeTitle( $ns, $textVariant ); - if(is_null($variantTitle)) continue; - $linkBatch->addObj( $variantTitle ); - $variantMap[$variantTitle->getPrefixedDBkey()][] = $key; - } - } - } - - # construct query - $titleClause = $linkBatch->constructSet('page', $dbr); - $variantQuery = "SELECT page_id, page_namespace, page_title"; - if ( $threshold > 0 ) { - $variantQuery .= ', page_len, page_is_redirect'; - } - $variantQuery .= ", page_no_title_convert FROM $page WHERE $titleClause"; - if ( $options & RLH_FOR_UPDATE ) { - $query .= ' FOR UPDATE'; - } - - $varRes = $dbr->query( $variantQuery, $fname ); - - # for each found variants, figure out link holders and replace - while ( $s = $dbr->fetchObject($varRes) ) { - - $variantTitle = Title::makeTitle( $s->page_namespace, $s->page_title ); - $varPdbk = $variantTitle->getPrefixedDBkey(); - $linkCache->addGoodLinkObj( $s->page_id, $variantTitle ); - $this->mOutput->addLink( $variantTitle, $s->page_id ); - - $noTitleConvert = $s->page_no_title_convert; - - $holderKeys = $variantMap[$varPdbk]; - - // loop over link holders - foreach($holderKeys as $key){ - $title = $this->mLinkHolders['titles'][$key]; - if ( is_null( $title ) ) continue; - - $pdbk = $title->getPrefixedDBkey(); - - if(!isset($colours[$pdbk]) || ($noTitleConvert && $colours[$pdbk] == 1)){ - // found link in some of the variants, replace the link holder data - $this->mLinkHolders['titles'][$key] = $variantTitle; - $this->mLinkHolders['dbkeys'][$key] = $variantTitle->getDBkey(); - - // prevent link conversion if needed - if($noTitleConvert) - $this->mLinkHolders['texts'][$key] = $wgContLang->markNoConversion($variantTitle->getText(),true); - - // set pdbk and colour - $pdbks[$key] = $varPdbk; - if ( $threshold > 0 ) { - $size = $s->page_len; - if ( $s->page_is_redirect || $s->page_namespace != 0 || $size >= $threshold ) { - $colours[$varPdbk] = 1; - } else { - $colours[$varPdbk] = 2; - } - } - else { - $colours[$varPdbk] = 1; - } - } - } - } - } - # Construct search and replace arrays wfProfileIn( $fname.'-construct' ); $wgOutputReplace = array(); diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 6af1e41596..c3b38519a7 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -51,7 +51,6 @@ class SearchEngine { * @private */ function getNearMatch( $term ) { - global $wgContLang; # Exact match? No need to look further. $title = Title::newFromText( $term ); if (is_null($title)) @@ -63,27 +62,33 @@ class SearchEngine { # Now try all lower case (i.e. first letter capitalized) # - $title = Title::newFromText( $wgContLang->lc( $term ) ); + $title = Title::newFromText( strtolower( $term ) ); if ( $title->exists() ) { return $title; } # Now try capitalized string # - $title = Title::newFromText( $wgContLang->ucwords( $term ) ); + $title = Title::newFromText( ucwords( strtolower( $term ) ) ); if ( $title->exists() ) { return $title; } # Now try all upper case # - $title = Title::newFromText( $wgContLang->uc( $term ) ); + $title = Title::newFromText( strtoupper( $term ) ); if ( $title->exists() ) { return $title; } # Now try Word-Caps-Breaking-At-Word-Breaks, for hyphenated names etc - $title = Title::newFromText( $wgContLang->ucwordbreaks($term) ); + $title = Title::newFromText( preg_replace_callback( + '/\b([\w\x80-\xff]+)\b/', + create_function( '$matches', ' + global $wgContLang; + return $wgContLang->ucfirst($matches[1]); + ' ), + $term ) ); if ( $title->exists() ) { return $title; } diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index 0c767ede4a..4667bd68b6 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -77,7 +77,6 @@ class SpecialSearch { function goResult( $term ) { global $wgOut; global $wgGoToEdit; - global $wgContLang; $this->setupPage( $term ); @@ -97,20 +96,6 @@ class SpecialSearch { return; } - # if language supports variants, search in all variants - if($wgContLang->hasVariants()){ - $allTermVariants = $wgContLang->convertLinkToAllVariants($term); - - foreach($allTermVariants as $termVariant){ - $t = SearchEngine::getNearMatch( $termVariant ); - if( !is_null( $t ) ) { - $wgOut->redirect( $t->getFullURL() ); - wfProfileOut( $fname ); - return; - } - } - } - # No match, generate an edit URL $t = Title::newFromText( $term ); if( is_null( $t ) ) { diff --git a/languages/Language.php b/languages/Language.php index bbd3bb08ee..c1f46ccbb6 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -49,10 +49,9 @@ class FakeConverter { function findVariantLink(&$l, &$n) {} function getExtraHashOptions() {return '';} function getParsedTitle() {return '';} - function markNoConversion($text, $noParse=false) {return $text;} + function markNoConversion($text) {return $text;} function convertCategoryKey( $key ) {return $key; } - function convertLinkToAllVariants($text){ return array( $this->mLang->getCode() => $text); } - function setNoTitleConvert(){} + } #-------------------------------------------------------------------------- @@ -713,34 +712,6 @@ class Language { return iconv( $in, $out, $string ); } - // callback functions for uc(), lc(), ucwords(), ucwordbreaks() - function ucwordbreaksCallbackAscii($matches){ - return $this->ucfirst($matches[1]); - } - - function ucwordbreaksCallbackMB($matches){ - return mb_strtoupper($matches[0]); - } - - function ucCallback($matches){ - global $wikiUpperChars; - return strtr( $matches[1] , $wikiUpperChars ); - } - - function lcCallback($matches){ - global $wikiLowerChars; - return strtr( $matches[1] , $wikiLowerChars ); - } - - function ucwordsCallbackMB($matches){ - return mb_strtoupper($matches[0]); - } - - function ucwordsCallbackWiki($matches){ - global $wikiUpperChars; - return strtr( $matches[0] , $wikiUpperChars ); - } - function ucfirst( $str ) { return self::uc( $str, true ); } @@ -758,9 +729,9 @@ class Language { if ( self::isMultibyte( $str ) ) { list( $wikiUpperChars ) = $this->getCaseMaps(); $x = $first ? '^' : ''; - return preg_replace_callback( - "/$x([a-z]|[\\xc0-\\xff][\\x80-\\xbf]*)/", - array($this,"ucCallback"), + return preg_replace( + "/$x([a-z]|[\\xc0-\\xff][\\x80-\\xbf]*)/e", + "strtr( \"\$1\" , \$wikiUpperChars )", $str ); } else @@ -784,9 +755,9 @@ class Language { if ( self::isMultibyte( $str ) ) { list( , $wikiLowerChars ) = self::getCaseMaps(); $x = $first ? '^' : ''; - return preg_replace_callback( - "/$x([A-Z]|[\\xc0-\\xff][\\x80-\\xbf]*)/", - array($this,"lcCallback"), + return preg_replace( + "/$x([A-Z]|[\\xc0-\\xff][\\x80-\\xbf]*)/e", + "strtr( \"\$1\" , \$wikiLowerChars )", $str ); } else @@ -797,66 +768,6 @@ class Language { return (bool)preg_match( '/[\x80-\xff]/', $str ); } - function ucwords($str) { - global $wikiUpperChars; - - if ( self::isMultibyte( $str ) ) { - $str = self::lc($str); - - // regexp to find first letter in each word (i.e. after each space) - $replaceRegexp = "/^([a-z]|[\\xc0-\\xff][\\x80-\\xbf]*)| ([a-z]|[\\xc0-\\xff][\\x80-\\xbf]*)/"; - - // function to use to capitalize a single char - if ( function_exists( 'mb_strtoupper' ) ) - return preg_replace_callback( - $replaceRegexp, - array($this,"ucwordsCallbackMB"), - $str - ); - else - return preg_replace_callback( - $replaceRegexp, - array($this,"ucwordsCallbackWiki"), - $str - ); - } - else - return ucwords( strtolower( $str ) ); - } - - # capitalize words at word breaks - function ucwordbreaks($str){ - global $wikiUpperChars; - - if (self::isMultibyte( $str ) ) { - $str = self::lc($str); - - // since \b doesn't work for UTF-8, we explicitely define word break chars - $breaks= "[ \-\(\)\}\{\.,\?!]"; - - // find first letter after word break - $replaceRegexp = "/^([a-z]|[\\xc0-\\xff][\\x80-\\xbf]*)|$breaks([a-z]|[\\xc0-\\xff][\\x80-\\xbf]*)/"; - - if ( function_exists( 'mb_strtoupper' ) ) - return preg_replace_callback( - $replaceRegexp, - array($this,"ucwordbreaksCallbackMB"), - $str - ); - else - return preg_replace_callback( - $replaceRegexp, - array($this,"ucwordsCallbackWiki"), - $str - ); - } - else - return preg_replace_callback( - '/\b([\w\x80-\xff]+)\b/', - array($this,"ucwordbreaksCallbackAscii"), - $str ); - } - function checkTitleEncoding( $s ) { if( is_array( $s ) ) { wfDebugDieBacktrace( 'Given array to checkTitleEncoding.' ); @@ -1258,17 +1169,6 @@ class Language { return $this->mConverter->parserConvert( $text, $parser ); } - # Tell the converter that it shouldn't convert titles - function setNoTitleConvert(){ - $this->mConverter->setNotitleConvert(); - } - - # Check if this is a language with variants - function hasVariants(){ - return sizeof($this->getVariants())>1; - } - - /** * Perform output conversion on a string, and encode for safe HTML output. * @param string $text @@ -1313,17 +1213,6 @@ class Language { $this->mConverter->findVariantLink($link, $nt); } - /** - * If a language supports multiple variants, converts text - * into an array of all possible variants of the text: - * 'variant' => text in that variant - */ - - function convertLinkToAllVariants($text){ - return $this->mConverter->convertLinkToAllVariants($text); - } - - /** * returns language specific options used by User::getPageRenderHash() * for example, the preferred language variant @@ -1353,8 +1242,8 @@ class Language { * @param string $text text to be tagged for no conversion * @return string the tagged text */ - function markNoConversion( $text, $noParse=false ) { - return $this->mConverter->markNoConversion( $text, $noParse ); + function markNoConversion( $text ) { + return $this->mConverter->markNoConversion( $text ); } /** diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 86283198d6..2e504360a9 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -22,7 +22,6 @@ class LanguageConverter { var $mMarkup; var $mFlags; var $mUcfirst = false; - var $mNoTitleConvert = false; /** * Constructor * @@ -39,7 +38,6 @@ class LanguageConverter { $markup=array(), $flags = array()) { global $wgDBname; - global $wgLegalTitleChars; $this->mLangObj = $langobj; $this->mMainLanguageCode = $maincode; $this->mVariants = $variants; @@ -157,17 +155,14 @@ class LanguageConverter { $marker = ""; // this one is needed when the text is inside an html markup - $htmlfix = '|<[^>]+$|^[^<>]*>'; + $htmlfix = '|<[^>]+=\"[^(>=)]*$|^[^(<>=\")]*\"[^>]*>'; - // disable convert to variants between tags - $codefix = '.+?<\/code>|'; - - $reg = '/'.$codefix.'<[^>]+>|&[a-z#][a-z0-9]+;' . $marker . $htmlfix . '/s'; + $reg = '/<[^>]+>|&[a-z#][a-z0-9]+;' . $marker . $htmlfix . '/'; $matches = preg_split($reg, $text, -1, PREG_SPLIT_OFFSET_CAPTURE); - $m = array_shift($matches); + $m = array_shift($matches); $ret = $this->translate($m[0], $toVariant); $mstart = $m[1]+strlen($m[0]); foreach($matches as $m) { @@ -202,7 +197,7 @@ class LanguageConverter { * * @param string $text the text to be converted * @return array of string - * @public + * @private */ function autoConvertToAllVariants($text) { $fname="LanguageConverter::autoConvertToAllVariants"; @@ -214,44 +209,10 @@ class LanguageConverter { foreach($this->mVariants as $variant) { $ret[$variant] = $this->translate($text, $variant); } - wfProfileOut( $fname ); return $ret; } - /** - * convert link text to all supported variants - * - * @param string $text the text to be converted - * @return array of string - * @public - */ - function convertLinkToAllVariants($text) { - if( !$this->mTablesLoaded ) - $this->loadTables(); - - $ret = array(); - $tarray = explode($this->mMarkup['begin'], $text); - $tfirst = array_shift($tarray); - - foreach($this->mVariants as $variant) - $ret[$variant] = $this->translate($tfirst,$variant); - - foreach($tarray as $txt) { - $marked = explode($this->mMarkup['end'], $txt, 2); - - foreach($this->mVariants as $variant){ - $ret[$variant] .= $this->mMarkup['begin'].$marked[0].$this->mMarkup['end']; - if(array_key_exists(1, $marked)) - $ret[$variant] .= $this->translate($marked[1],$variant); - } - - } - - return $ret; - } - - /** * Convert text using a parser object for context */ @@ -259,7 +220,7 @@ class LanguageConverter { global $wgDisableLangConversion; /* don't do anything if this is the conversion table */ if ( $parser->mTitle->getNamespace() == NS_MEDIAWIKI && - strpos($parser->mTitle->getText(), "Conversiontable") !== false ) + strpos($parser->mTitle->getText, "Conversiontable") !== false ) { return $text; } @@ -303,11 +264,6 @@ class LanguageConverter { return $text; if( $isTitle ) { - if($this->mNoTitleConvert){ - $this->mTitleDisplay = $text; - return $text; - } - if( !$this->mDoTitleConvert ) { $this->mTitleDisplay = $text; return $text; @@ -322,7 +278,7 @@ class LanguageConverter { return $text; } else { - $this->mTitleDisplay = $this->convert($text); + $this->mTitleDisplay = $this->autoConvert($text); return $this->mTitleDisplay; } } @@ -359,7 +315,7 @@ class LanguageConverter { else $rules = $marked[0]; - //FIXME: may cause trouble here... +#FIXME: may cause trouble here... //strip   since it interferes with the parsing, plus, //all spaces should be stripped in this tag anyway. $rules = str_replace(' ', '', $rules); @@ -454,16 +410,23 @@ class LanguageConverter { * @access public */ function findVariantLink( &$link, &$nt ) { + static $count=0; //used to limit this operation + static $cache=array(); global $wgDisableLangConversion; $pref = $this->getPreferredVariant(); $ns=0; if(is_object($nt)) $ns = $nt->getNamespace(); - + if( $count > 50 && $ns != NS_CATEGORY ) + return; + $count++; $variants = $this->autoConvertToAllVariants($link); if($variants == false) //give up return; foreach( $variants as $v ) { + if(isset($cache[$v])) + continue; + $cache[$v] = 1; $varnt = Title::newFromText( $v, $ns ); if( $varnt && $varnt->getArticleID() > 0 ) { $nt = $varnt; @@ -692,7 +655,7 @@ class LanguageConverter { * @param string $text text to be tagged for no conversion * @return string the tagged text */ - function markNoConversion($text, $noParse=false) { + function markNoConversion($text) { # don't mark if already marked if(strpos($text, $this->mMarkup['begin']) || strpos($text, $this->mMarkup['end'])) @@ -733,11 +696,6 @@ class LanguageConverter { } return true; } - - function setNoTitleConvert(){ - $this->mNoTitleConvert = true; - } - } ?> diff --git a/languages/LanguageSr.php b/languages/LanguageSr.php index d295adfb5f..4258322bfb 100644 --- a/languages/LanguageSr.php +++ b/languages/LanguageSr.php @@ -169,8 +169,8 @@ class SrConverter extends LanguageConverter { * We want our external link captions to be converted in variants, * so we return the original text instead -{$text}-, except for URLs */ - function markNoConversion($text, $noParse=false) { - if($noParse || preg_match("/^https?:\/\/|ftp:\/\/|irc:\/\//",$text)) + function markNoConversion($text) { + if(preg_match("/^https?:\/\/|ftp:\/\/|irc:\/\//",$text)) return parent::markNoConversion($text); return $text; } @@ -188,51 +188,22 @@ class SrConverter extends LanguageConverter { return parent::autoConvert($text,$toVariant); } - /** - * It translates text into variant, specials: - * - ommiting roman numbers - */ - function translate($text, $toVariant){ - $breaks = '[^\w\x80-\xff]'; - - // regexp for roman numbers - $roman = 'M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})'; - - $reg = '/^'.$roman.'$|^'.$roman.$breaks.'|'.$breaks.$roman.'$|'.$breaks.$roman.$breaks.'/'; - - $matches = preg_split($reg, $text, -1, PREG_SPLIT_OFFSET_CAPTURE); - - $m = array_shift($matches); - $ret = strtr($m[0], $this->mTables[$toVariant]); - $mstart = $m[1]+strlen($m[0]); - foreach($matches as $m) { - $ret .= substr($text, $mstart, $m[1]-$mstart); - $ret .= parent::translate($m[0], $toVariant); - $mstart = $m[1] + strlen($m[0]); - } - - return $ret; - } - } class LanguageSr extends LanguageSr_ec { function __construct() { global $wgHooks; - parent::__construct(); - // these variants are currently UNUSED: - // 'sr-jc', 'sr-jl' - $variants = array('sr', 'sr-ec', 'sr-el'); + $variants = array('sr', 'sr-ec', 'sr-jc', 'sr-el', 'sr-jl'); $variantfallbacks = array( 'sr' => 'sr-ec', - 'sr-ec' => 'sr-ec', - 'sr-el' => 'sr-el', - ); - - + 'sr-ec' => 'sr-jc', + 'sr-jc' => 'sr-ec', + 'sr-el' => 'sr-jl', + 'sr-jl' => 'sr-el' + ); $marker = array();//don't mess with these, leave them as they are $flags = array( 'S' => 'S', 'писмо' => 'S', 'pismo' => 'S', diff --git a/languages/MessagesSr_ec.php b/languages/MessagesSr_ec.php index 6bdc46000f..75d8279340 100644 --- a/languages/MessagesSr_ec.php +++ b/languages/MessagesSr_ec.php @@ -173,7 +173,7 @@ $magicWords = array( 'servername' => array( 0, 'SERVERNAME', 'ИМЕСЕРВЕРА' ), 'scriptpath' => array( 0, 'SCRIPTPATH', 'СКРИПТА' ), 'grammar' => array( 0, 'GRAMMAR:', 'ГРАМАТИКА:' ), - 'notitleconvert' => array( 0, '__NOTITLECONVERT__', '__NOTC__', '__БЕЗКН__', '__BEZKN__' ), + 'notitleconvert' => array( 0, '__NOTITLECONVERT__', '__NOTC__', '__БЕЗТЦ__' ), 'nocontentconvert' => array( 0, '__NOCONTENTCONVERT__', '__NOCC__', '__БЕЗЦЦ__' ), 'currentweek' => array( 1, 'CURRENTWEEK', 'ТРЕНУТНАНЕДЕЉА' ), 'currentdow' => array( 1, 'CURRENTDOW', 'ТРЕНУТНИДОВ' ), diff --git a/languages/MessagesSr_el.php b/languages/MessagesSr_el.php index fad7ddb012..c8bcf375c5 100644 --- a/languages/MessagesSr_el.php +++ b/languages/MessagesSr_el.php @@ -175,7 +175,7 @@ $magicWords = array( 'servername' => array( 0, 'SERVERNAME', 'IMESERVERA' ), 'scriptpath' => array( 0, 'SCRIPTPATH', 'SKRIPTA' ), 'grammar' => array( 0, 'GRAMMAR:', 'GRAMATIKA:' ), - 'notitleconvert' => array( 0, '__NOTITLECONVERT__', '__NOTC__', '__БЕЗКН__', '__BEZKN__' ), + 'notitleconvert' => array( 0, '__NOTITLECONVERT__', '__NOTC__', '__BEZTC__' ), 'nocontentconvert' => array( 0, '__NOCONTENTCONVERT__', '__NOCC__', '__BEZCC__' ), 'currentweek' => array( 1, 'CURRENTWEEK', 'TRENUTNANEDELjA' ), 'currentdow' => array( 1, 'CURRENTDOW', 'TRENUTNIDOV' ), diff --git a/maintenance/archives/patch-page_no_title_convert.sql b/maintenance/archives/patch-page_no_title_convert.sql index f74b801356..e69de29bb2 100644 --- a/maintenance/archives/patch-page_no_title_convert.sql +++ b/maintenance/archives/patch-page_no_title_convert.sql @@ -1,7 +0,0 @@ --- Used to prevent title conversion (only for languagues with variants) --- Set to 1 if the page contains __NOTITLECONVERT__ magic word. --- --- Added 2006-07-21 - -ALTER TABLE /*$wgDBprefix*/page - ADD page_no_title_convert bool NOT NULL default 0; diff --git a/maintenance/mysql5/tables.sql b/maintenance/mysql5/tables.sql index db65cb8f75..81a4690adc 100644 --- a/maintenance/mysql5/tables.sql +++ b/maintenance/mysql5/tables.sql @@ -218,10 +218,6 @@ CREATE TABLE /*$wgDBprefix*/page ( -- Uncompressed length in bytes of the page's current source text. page_len int(8) unsigned NOT NULL, - -- Set to 1 if the page contains __NOTITLECONVERT__ magic word. - -- Used only for languages with variants to prevent title conversion - page_no_title_convert bool NOT NULL default 0, - PRIMARY KEY page_id (page_id), UNIQUE INDEX name_title (page_namespace,page_title), diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 7c2099b634..3ffa5e5f66 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -206,10 +206,6 @@ CREATE TABLE /*$wgDBprefix*/page ( -- Uncompressed length in bytes of the page's current source text. page_len int(8) unsigned NOT NULL, - -- Set to 1 if the page contains __NOTITLECONVERT__ magic word. - -- Used only for languages with variants to prevent title conversion - page_no_title_convert bool NOT NULL default 0, - PRIMARY KEY page_id (page_id), UNIQUE INDEX name_title (page_namespace,page_title), diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index cc47fd4e52..9acf302b6f 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -57,7 +57,6 @@ $wgNewFields = array( array( 'ipblocks', 'ipb_range_start', 'patch-ipb_range_start.sql' ), array( 'site_stats', 'ss_images', 'patch-ss_images.sql' ), array( 'ipblocks', 'ipb_anon_only', 'patch-ipb_anon_only.sql' ), - array( 'page', 'page_no_title_convert','patch-page_no_title_convert.sql' ), ); function rename_table( $from, $to, $patch ) { -- 2.20.1