Page MenuHomePhabricator
Authored By
bzimport
Nov 21 2014, 8:26 PM
Size
67 KB
Referenced Files
None
Subscribers
None
Index: maintenance/parserTests.inc
===================================================================
--- maintenance/parserTests.inc (revision 14788)
+++ maintenance/parserTests.inc (working copy)
@@ -31,7 +31,7 @@
require_once( 'commandLine.inc' );
require_once( "$IP/includes/ObjectCache.php" );
require_once( "$IP/includes/BagOStuff.php" );
-require_once( "$IP/languages/LanguageUtf8.php" );
+require_once( "$IP/languages/Language.php" );
require_once( "$IP/includes/Hooks.php" );
require_once( "$IP/maintenance/parserTestsParserHook.php" );
require_once( "$IP/maintenance/parserTestsStaticParserHook.php" );
Index: maintenance/languages.inc
===================================================================
--- maintenance/languages.inc (revision 14788)
+++ maintenance/languages.inc (working copy)
@@ -38,7 +38,7 @@
// Cleanup file list
foreach($this->list as $key => $lang) {
- if ($lang == 'Utf8' || $lang == '' || $lang == 'Converter')
+ if ($lang == '' || $lang == 'Converter')
unset($this->list[$key]);
}
}
Index: tests/SearchEngineTest.php
===================================================================
--- tests/SearchEngineTest.php (revision 14788)
+++ tests/SearchEngineTest.php (working copy)
@@ -8,7 +8,6 @@
require_once( '../includes/Hooks.php' );
require_once( '../includes/MagicWord.php' );
require_once( '../languages/Language.php' );
-require_once( '../languages/LanguageUtf8.php' );
require_once( '../includes/SearchEngine.php' );
Index: tests/SearchMySQL4Test.php
===================================================================
--- tests/SearchMySQL4Test.php (revision 14788)
+++ tests/SearchMySQL4Test.php (working copy)
@@ -11,7 +11,7 @@
}
function setUp() {
- $GLOBALS['wgContLang'] = new LanguageUtf8;
+ $GLOBALS['wgContLang'] = new Language;
$this->db =& buildTestDatabase(
'mysql4',
array( 'page', 'revision', 'text', 'searchindex' ) );
Index: languages/LanguageDe.php
===================================================================
--- languages/LanguageDe.php (revision 14788)
+++ languages/LanguageDe.php (working copy)
@@ -7,9 +7,6 @@
* @bug 4563
*/
-/** */
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesDe = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Spezial',
@@ -61,8 +58,7 @@
require_once('MessagesDe.php');
}
-/** @package MediaWiki */
-class LanguageDe extends LanguageUtf8 {
+class LanguageDe extends Language {
function getBookstoreList() {
global $wgBookstoreListDe ;
Index: languages/LanguageSv.php
===================================================================
--- languages/LanguageSv.php (revision 14788)
+++ languages/LanguageSv.php (working copy)
@@ -6,13 +6,11 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesSv.php');
}
-class LanguageSv extends LanguageUtf8 {
+class LanguageSv extends Language {
private $mMessagesSv, $mNamespaceNamesSv;
private $mQuickbarSettingsSv = array(
@@ -29,7 +27,7 @@
);
function LanguageSv() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesSv;
$this->mMessagesSv =& $wgAllMessagesSv;
Index: languages/LanguageLa.php
===================================================================
--- languages/LanguageLa.php (revision 14788)
+++ languages/LanguageLa.php (working copy)
@@ -9,7 +9,7 @@
require_once('MessagesLa.php');
}
-class LanguageLa extends LanguageUtf8 {
+class LanguageLa extends Language {
private $mMessagesLa, $mNamespaceNamesLa = null;
private $mQuickbarSettingsLa = array(
@@ -23,7 +23,7 @@
);
function LanguageLa() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesLa;
$this->mMessagesLa =& $wgAllMessagesLa;
Index: languages/LanguageLi.php
===================================================================
--- languages/LanguageLi.php (revision 14788)
+++ languages/LanguageLi.php (working copy)
@@ -43,11 +43,8 @@
require_once('MessagesLi.php');
}
+class LanguageLi extends Language {
-require_once( "LanguageUtf8.php" );
-
-class LanguageLi extends LanguageUtf8 {
-
function getNamespaces() {
global $wgNamespaceNamesLi;
return $wgNamespaceNamesLi;
Index: languages/LanguageTa.php
===================================================================
--- languages/LanguageTa.php (revision 14788)
+++ languages/LanguageTa.php (working copy)
@@ -4,8 +4,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
#--------------------------------------------------------------------------
# Language-specific text
#--------------------------------------------------------------------------
@@ -51,7 +49,7 @@
require_once('MessagesTa.php');
}
-class LanguageTa extends LanguageUtf8 {
+class LanguageTa extends Language {
function getNsIndex( $text ) {
$ns = $this->getNamespaces();
Index: languages/LanguageCsb.php
===================================================================
--- languages/LanguageCsb.php (revision 14788)
+++ languages/LanguageCsb.php (working copy)
@@ -29,8 +29,7 @@
require_once('MessagesCsb.php');
}
-require_once( 'LanguageUtf8.php' );
-class LanguageCsb extends LanguageUtf8 {
+class LanguageCsb extends Language {
function getNamespaces() {
global $wgNamespaceNamesCsb;
return $wgNamespaceNamesCsb;
Index: languages/LanguageTe.php
===================================================================
--- languages/LanguageTe.php (revision 14788)
+++ languages/LanguageTe.php (working copy)
@@ -7,10 +7,8 @@
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
*/
-require_once( 'LanguageUtf8.php' );
+class LanguageTe extends Language {
-class LanguageTe extends LanguageUtf8 {
-
function digitTransformTable() {
return array(
'0' => '౦',
Index: languages/LanguageHr.php
===================================================================
--- languages/LanguageHr.php (revision 14788)
+++ languages/LanguageHr.php (working copy)
@@ -5,9 +5,6 @@
* @subpackage Language
*/
-/** */
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesHr = array(
NS_MEDIA => "Mediji",
NS_SPECIAL => "Posebno",
@@ -54,7 +51,7 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageHr extends LanguageUtf8 {
+class LanguageHr extends Language {
function getNamespaces() {
global $wgNamespaceNamesHr;
Index: languages/LanguageLo.php
===================================================================
--- languages/LanguageLo.php (revision 14788)
+++ languages/LanguageLo.php (working copy)
@@ -7,9 +7,7 @@
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageLo extends LanguageUtf8 {
+class LanguageLo extends Language {
function digitTransformTable() {
return array(
'0' => '໐',
Index: languages/LanguagePl.php
===================================================================
--- languages/LanguagePl.php (revision 14788)
+++ languages/LanguagePl.php (working copy)
@@ -3,7 +3,6 @@
* @package MediaWiki
* @subpackage Language
*/
-require_once("LanguageUtf8.php");
# Yucky hardcoding hack as polish grammar need tweaking :o)
switch( $wgMetaNamespace ) {
@@ -66,7 +65,7 @@
require_once('MessagesPl.php');
}
-class LanguagePl extends LanguageUtf8 {
+class LanguagePl extends Language {
function getNamespaces() {
global $wgNamespaceNamesPl;
Index: languages/LanguagePt.php
===================================================================
--- languages/LanguagePt.php (revision 14788)
+++ languages/LanguagePt.php (working copy)
@@ -13,8 +13,6 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
#
# In general you should not make customizations in these language files
# directly, but should use the MediaWiki: special namespace to customize
@@ -136,7 +134,7 @@
require_once('MessagesPt.php');
}
-class LanguagePt extends LanguageUtf8 {
+class LanguagePt extends Language {
/**
* Portuguese numeric format is 123 456,78
Index: languages/LanguageIa.php
===================================================================
--- languages/LanguageIa.php (revision 14788)
+++ languages/LanguageIa.php (working copy)
@@ -5,13 +5,11 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesIa.php');
}
-class LanguageIa extends LanguageUtf8 {
+class LanguageIa extends Language {
private $mMessagesIa, $mNamespaceNamesIa = null;
private $mQuickbarSettingsIa = array(
@@ -24,7 +22,7 @@
function LanguageIa() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesIa;
$this->mMessagesIa =& $wgAllMessagesIa;
Index: languages/LanguageZh_tw.php
===================================================================
--- languages/LanguageZh_tw.php (revision 14788)
+++ languages/LanguageZh_tw.php (working copy)
@@ -3,7 +3,6 @@
* @package MediaWiki
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
require_once( "LanguageZh_cn.php" );
/* private */ $wgNamespaceNamesZh_tw = array(
Index: languages/LanguageEl.php
===================================================================
--- languages/LanguageEl.php (revision 14788)
+++ languages/LanguageEl.php (working copy)
@@ -27,9 +27,6 @@
* @subpackage Language
*/
-/** */
-require_once( 'LanguageUtf8.php' );
-
$wgNamespaceNamesEl = array(
NS_MEDIA => 'Μέσον',
NS_SPECIAL => 'Ειδικό',
@@ -56,7 +53,7 @@
}
/** @package MediaWiki */
-class LanguageEl extends LanguageUtf8 {
+class LanguageEl extends Language {
function getNamespaces() {
global $wgNamespaceNamesEl;
Index: languages/LanguageEn.php
===================================================================
--- languages/LanguageEn.php (revision 14788)
+++ languages/LanguageEn.php (working copy)
@@ -5,11 +5,8 @@
* @subpackage Language
*/
-/** */
-require_once( 'LanguageUtf8.php' );
-
/** @package MediaWiki */
-class LanguageEn extends LanguageUtf8 {
+class LanguageEn extends Language {
# Inherit everything
}
Index: languages/LanguageAs.php
===================================================================
--- languages/LanguageAs.php (revision 14788)
+++ languages/LanguageAs.php (working copy)
@@ -5,9 +5,7 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageAs extends LanguageUtf8 {
+class LanguageAs extends Language {
function digitTransformTable() {
return array(
'0' => '০',
Index: languages/LanguageMl.php
===================================================================
--- languages/LanguageMl.php (revision 14788)
+++ languages/LanguageMl.php (working copy)
@@ -7,9 +7,7 @@
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageMl extends LanguageUtf8 {
+class LanguageMl extends Language {
function digitTransformTable() {
return array(
'0' => '൦',
Index: languages/LanguageEt.php
===================================================================
--- languages/LanguageEt.php (revision 14788)
+++ languages/LanguageEt.php (working copy)
@@ -108,11 +108,9 @@
require_once('MessagesEt.php');
}
-require_once( "LanguageUtf8.php" );
+class LanguageEt extends Language {
-class LanguageEt extends LanguageUtf8 {
-
function getBookstoreList () {
global $wgBookstoreListEt ;
return $wgBookstoreListEt ;
Index: languages/LanguageIs.php
===================================================================
--- languages/LanguageIs.php (revision 14788)
+++ languages/LanguageIs.php (working copy)
@@ -6,8 +6,6 @@
# Most of this was written by Ævar Arnfjörð Bjarmason <avarab@gmail.com>
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesIs = array(
NS_MEDIA => 'Miðill',
NS_SPECIAL => 'Kerfissíða',
@@ -61,7 +59,7 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageIs extends LanguageUtf8 {
+class LanguageIs extends Language {
function getNamespaces() {
global $wgNamespaceNamesIs;
Index: languages/LanguageYi.php
===================================================================
--- languages/LanguageYi.php (revision 14788)
+++ languages/LanguageYi.php (working copy)
@@ -7,17 +7,15 @@
* @subpackage Language
*/
-require_once 'LanguageUtf8.php';
-
if (!$wgCachedMessageArrays) {
require_once('MessagesYi.php');
}
-class LanguageYi extends LanguageUtf8 {
+class LanguageYi extends Language {
private $mMessagesYi, $mNamespaceNamesYi = null;
function LanguageYi() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesYi;
$this->mMessagesYi =& $wgAllMessagesYi;
Index: languages/LanguageFa.php
===================================================================
--- languages/LanguageFa.php (revision 14788)
+++ languages/LanguageFa.php (working copy)
@@ -7,8 +7,6 @@
# Wikipedia localization for Persian
-require_once('LanguageUtf8.php');
-
#--------------------------------------------------------------------------
# Language-specific text
#--------------------------------------------------------------------------
@@ -54,7 +52,7 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageFa extends LanguageUtf8 {
+class LanguageFa extends Language {
function digitTransformTable() {
return array(
"0" => "۰",
Index: languages/LanguageUr.php
===================================================================
--- languages/LanguageUr.php (revision 14788)
+++ languages/LanguageUr.php (working copy)
@@ -6,10 +6,8 @@
# Stub for Urdu
-require_once( "LanguageUtf8.php" );
+class LanguageUr extends Language {
-class LanguageUr extends LanguageUtf8 {
-
function getDefaultUserOptions() {
$opt = parent::getDefaultUserOptions();
$opt["quickbar"] = 2; # Right-to-left
Index: languages/LanguageFi.php
===================================================================
--- languages/LanguageFi.php (revision 14788)
+++ languages/LanguageFi.php (working copy)
@@ -7,13 +7,11 @@
* @author Niklas Laxström
*/
-require_once( 'LanguageUtf8.php' );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesFi.php');
}
-class LanguageFi extends LanguageUtf8 {
+class LanguageFi extends Language {
private $mMessagesFi, $mNamespaceNamesFi = null;
private $mSkinNamesFi = array(
@@ -42,7 +40,7 @@
);
function LanguageFi() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesFi;
$this->mMessagesFi =& $wgAllMessagesFi;
Index: languages/LanguageBn.php
===================================================================
--- languages/LanguageBn.php (revision 14788)
+++ languages/LanguageBn.php (working copy)
@@ -5,9 +5,6 @@
* @subpackage Language
*/
-/** This is an UTF8 language */
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesBn = array(
NS_SPECIAL => 'বিশেষ',
NS_MAIN => '',
@@ -27,7 +24,7 @@
require_once('MessagesBn.php');
}
-class LanguageBn extends LanguageUtf8 {
+class LanguageBn extends Language {
function getNamespaces() {
global $wgNamespaceNamesBn;
return $wgNamespaceNamesBn;
Index: languages/LanguageBr.php
===================================================================
--- languages/LanguageBr.php (revision 14788)
+++ languages/LanguageBr.php (working copy)
@@ -4,8 +4,6 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesBr = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Dibar',
@@ -56,7 +54,7 @@
require_once('MessagesBr.php');
}
-class LanguageBr extends LanguageUtf8 {
+class LanguageBr extends Language {
function getBookstoreList () {
global $wgBookstoreListBr ;
Index: languages/LanguageFo.php
===================================================================
--- languages/LanguageFo.php (revision 14788)
+++ languages/LanguageFo.php (working copy)
@@ -4,7 +4,6 @@
* @package MediaWiki
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php');
/* private */ $wgNamespaceNamesFo = array(
NS_MEDIA => "Miðil",
@@ -47,7 +46,7 @@
require_once('MessagesFo.php');
}
-class LanguageFo extends LanguageUtf8 {
+class LanguageFo extends Language {
function getBookstoreList () {
global $wgBookstoreListFo ;
Index: languages/LanguageNo.php
===================================================================
--- languages/LanguageNo.php (revision 14788)
+++ languages/LanguageNo.php (working copy)
@@ -49,10 +49,8 @@
require_once('MessagesNo.php');
}
-require_once( "LanguageUtf8.php" );
+class LanguageNo extends Language {
-class LanguageNo extends LanguageUtf8 {
-
function getBookstoreList () {
global $wgBookstoreListNo ;
return $wgBookstoreListNo ;
Index: languages/LanguageVi.php
===================================================================
--- languages/LanguageVi.php (revision 14788)
+++ languages/LanguageVi.php (working copy)
@@ -8,8 +8,6 @@
* Last update 28 August 2005 (UTC)
*/
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesVi = array(
NS_MEDIA => 'Phương_tiện',
NS_SPECIAL => 'Đặc_biệt',
@@ -105,7 +103,7 @@
}
-class LanguageVi extends LanguageUtf8 {
+class LanguageVi extends Language {
function getBookstoreList () {
global $wgBookstoreListVi ;
Index: languages/LanguageFy.php
===================================================================
--- languages/LanguageFy.php (revision 14788)
+++ languages/LanguageFy.php (working copy)
@@ -4,8 +4,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesFy = array(
NS_MEDIA => "Media",
NS_SPECIAL => "Wiki",
@@ -52,7 +50,7 @@
require_once('MessagesFy.php');
}
-class LanguageFy extends LanguageUtf8 {
+class LanguageFy extends Language {
function getBookstoreList () {
global $wgBookstoreListFy ;
Index: languages/Language.php
===================================================================
--- languages/Language.php (revision 14788)
+++ languages/Language.php (working copy)
@@ -735,41 +735,73 @@
return iconv( $in, $out, $string );
}
- function ucfirst( $string ) {
- # For most languages, this is a wrapper for ucfirst()
- return ucfirst( $string );
+ function ucfirst( $str ) {
+ return Language::uc( $str, true );
}
- function uc( $str ) {
- return strtoupper( $str );
+ function uc( $str, $first = false ) {
+ if ( function_exists( 'mb_strtoupper' ) )
+ if ( $first )
+ if ( Language::isMultibyte( $str ) )
+ return mb_strtoupper( mb_substr( $str, 0, 1 ) ) . mb_substr( $str, 1 );
+ else
+ return ucfirst( $str );
+ else
+ return Language::isMultibyte( $str ) ? mb_strtoupper( $str ) : strtoupper( $str );
+ else
+ if ( Language::isMultibyte( $str ) ) {
+ global $wikiUpperChars;
+ $x = $first ? '^' : '';
+ return preg_replace(
+ "/$x([a-z]|[\\xc0-\\xff][\\x80-\\xbf]*)/e",
+ "strtr( \"\$1\" , \$wikiUpperChars )",
+ $str
+ );
+ } else
+ return $first ? ucfirst( $str ) : strtoupper( $str );
}
- function lcfirst( $s ) {
- return strtolower( $s{0} ). substr( $s, 1 );
+ function lcfirst( $str ) {
+ return Language::lc( $str, true );
}
- function lc( $str ) {
- return strtolower( $str );
+ function lc( $str, $first = false ) {
+ if ( function_exists( 'mb_strtolower' ) )
+ if ( $first )
+ if ( Language::isMultibyte( $str ) )
+ return mb_strtolower( mb_substr( $str, 0, 1 ) ) . mb_substr( $str, 1 );
+ else
+ return strtolower( substr( $str, 0, 1 ) ) . substr( $str, 1 );
+ else
+ return Language::isMultibyte( $str ) ? mb_strtolower( $str ) : strtolower( $str );
+ else
+ if ( Language::isMultibyte( $str ) ) {
+ global $wikiLowerChars;
+ $x = $first ? '^' : '';
+ return preg_replace(
+ "/$x([A-Z]|[\\xc0-\\xff][\\x80-\\xbf]*)/e",
+ "strtr( \"\$1\" , \$wikiLowerChars )",
+ $str
+ );
+ } else
+ return $first ? strtolower( substr( $str, 0, 1 ) ) . substr( $str, 1 ) : strtolower( $str );
}
function checkTitleEncoding( $s ) {
global $wgInputEncoding;
- # Check for UTF-8 URLs; Internet Explorer produces these if you
- # type non-ASCII chars in the URL bar or follow unescaped links.
+ if( is_array( $s ) ) {
+ wfDebugDieBacktrace( 'Given array to checkTitleEncoding.' );
+ }
+ # Check for non-UTF-8 URLs
$ishigh = preg_match( '/[\x80-\xff]/', $s);
- $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
- '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
+ if(!$ishigh) return $s;
- if( ($wgInputEncoding != 'utf-8') and $ishigh and $isutf )
- return @iconv( 'UTF-8', $wgInputEncoding, $s );
+ $isutf8 = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
+ '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );
+ if( $isutf8 ) return $s;
- if( ($wgInputEncoding == 'utf-8') and $ishigh and !$isutf )
- return utf8_encode( $s );
-
- # Other languages can safely leave this function, or replace
- # it with one to detect and convert another legacy encoding.
- return $s;
+ return $this->iconv( $this->fallback8bitEncoding(), "utf-8", $s );
}
/**
@@ -777,11 +809,33 @@
* or characters which need to be converted for MySQL's
* indexing to grok it correctly. Make such changes here.
*
- * @param string $in
+ * @param string $string
* @return string
*/
- function stripForSearch( $in ) {
- return strtolower( $in );
+ function stripForSearch( $string ) {
+ # MySQL fulltext index doesn't grok utf-8, so we
+ # need to fold cases and convert to hex
+
+ # In Language:: it just returns lowercase, maybe
+ # all strtolower on stripped output or argument
+ # should be removed and all stripForSearch
+ # methods adjusted to that.
+
+ wfProfileIn( "Language::stripForSearch" );
+ if( function_exists( 'mb_strtolower' ) ) {
+ $out = preg_replace(
+ "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
+ "'U8' . bin2hex( \"$1\" )",
+ mb_strtolower( $string ) );
+ } else {
+ global $wikiLowerChars;
+ $out = preg_replace(
+ "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
+ "'U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )",
+ $string );
+ }
+ wfProfileOut( "Language::stripForSearch" );
+ return $out;
}
function convertForSearchResult( $termsArray ) {
@@ -799,7 +853,10 @@
* @return string
*/
function firstChar( $s ) {
- return $s[0];
+ preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
+ '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})/', $s, $matches);
+
+ return isset( $matches[1] ) ? $matches[1] : "";
}
function initEncoding() {
@@ -984,7 +1041,7 @@
#
# $length does not include the optional ellipsis.
# If $length is negative, snip from the beginning
- function truncate( $string, $length, $ellipsis = '' ) {
+ function truncate( $string, $length, $ellipsis = "" ) {
if( $length == 0 ) {
return $ellipsis;
}
@@ -993,9 +1050,24 @@
}
if( $length > 0 ) {
$string = substr( $string, 0, $length );
+ $char = ord( $string[strlen( $string ) - 1] );
+ if ($char >= 0xc0) {
+ # We got the first byte only of a multibyte char; remove it.
+ $string = substr( $string, 0, -1 );
+ } elseif( $char >= 0x80 &&
+ preg_match( '/^(.*)(?:[\xe0-\xef][\x80-\xbf]|' .
+ '[\xf0-\xf7][\x80-\xbf]{1,2})$/', $string, $m ) ) {
+ # We chopped in the middle of a character; remove it
+ $string = $m[1];
+ }
return $string . $ellipsis;
} else {
$string = substr( $string, $length );
+ $char = ord( $string[0] );
+ if( $char >= 0x80 && $char < 0xc0 ) {
+ # We chopped in the middle of a character; remove the whole thing
+ $string = preg_replace( '/^[\x80-\xbf]+/', '', $string );
+ }
return $ellipsis . $string;
}
}
@@ -1193,13 +1265,34 @@
return str_replace( '_', '-', strtolower( substr( get_class( $this ), 8 ) ) );
}
+ function isMultibyte( $str ) {
+ return (bool)preg_match( '/^[\x80-\xff]/', $str );
+ }
+ function fallback8bitEncoding() {
+ # Windows codepage 1252 is a superset of iso 8859-1
+ # override this to use difference source encoding to
+ # translate incoming 8-bit URLs.
+ return "windows-1252";
+ }
}
-# FIXME: Merge all UTF-8 support code into Language base class.
-# We no longer support Latin-1 charset.
-require_once( 'LanguageUtf8.php' );
+if( function_exists( 'mb_strtoupper' ) ) {
+ mb_internal_encoding('UTF-8');
+} else {
+ # Hack our own case conversion routines
+ # Loading serialized arrays is faster than parsing code :P
+ $wikiUpperChars = $wgMemc->get( $key1 = "$wgDBname:utf8:upper" );
+ $wikiLowerChars = $wgMemc->get( $key2 = "$wgDBname:utf8:lower" );
+
+ if(empty( $wikiUpperChars) || empty($wikiLowerChars )) {
+ require_once( "includes/Utf8Case.php" );
+ $wgMemc->set( $key1, $wikiUpperChars );
+ $wgMemc->set( $key2, $wikiLowerChars );
+ }
+}
+
# This should fail gracefully if there's not a localization available
wfSuppressWarnings();
// Preload base classes to work around APC/PHP5 bug
Index: languages/LanguageZh.php
===================================================================
--- languages/LanguageZh.php (revision 14788)
+++ languages/LanguageZh.php (working copy)
@@ -86,7 +86,7 @@
//other way around
$t = $this->mConverter->autoConvert($t, 'zh-cn');
- $t = LanguageUtf8::stripForSearch( $t );
+ $t = parent::stripForSearch( $t );
wfProfileOut( $fname );
return $t;
Index: languages/LanguageCa.php
===================================================================
--- languages/LanguageCa.php (revision 14788)
+++ languages/LanguageCa.php (working copy)
@@ -5,13 +5,11 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesCa.php');
}
-class LanguageCa extends LanguageUtf8 {
+class LanguageCa extends Language {
private $mMessagesCa, $mNamespaceNamesCa = null;
private $mQuickbarSettingsCa = array(
@@ -30,7 +28,7 @@
);
function LanguageCa() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesCa;
$this->mMessagesCa =& $wgAllMessagesCa;
Index: languages/LanguageKa.php
===================================================================
--- languages/LanguageKa.php (revision 14788)
+++ languages/LanguageKa.php (working copy)
@@ -5,9 +5,6 @@
* @subpackage Language
*/
-/** */
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesKa = array(
NS_MEDIA => 'მედია',
NS_SPECIAL => 'სპეციალური',
@@ -29,7 +26,7 @@
NS_CATEGORY_TALK => 'კატეგორია_განხილვა'
) + $wgNamespaceNamesEn;
-class LanguageKa extends LanguageUtf8 {
+class LanguageKa extends Language {
function getNamespaces() {
global $wgNamespaceNamesKa;
return $wgNamespaceNamesKa;
Index: languages/LanguageSr_ec.php
===================================================================
--- languages/LanguageSr_ec.php (revision 14788)
+++ languages/LanguageSr_ec.php (working copy)
@@ -4,8 +4,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesSr_ec = array(
NS_MEDIA => "Медија",
NS_SPECIAL => "Посебно",
@@ -123,7 +121,7 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageSr_ec extends LanguageUtf8 {
+class LanguageSr_ec extends Language {
function getNamespaces() {
global $wgNamespaceNamesSr_ec;
Index: languages/LanguageArc.php
===================================================================
--- languages/LanguageArc.php (revision 14788)
+++ languages/LanguageArc.php (working copy)
@@ -5,9 +5,9 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
+require_once( 'Language.php' );
-class LanguageArc extends LanguageUtf8 {
+class LanguageArc extends Language {
function getAllMessages() {
return null;
Index: languages/LanguageCs.php
===================================================================
--- languages/LanguageCs.php (revision 14788)
+++ languages/LanguageCs.php (working copy)
@@ -5,9 +5,6 @@
* @subpackage Language
*/
-/** */
-require_once( 'LanguageUtf8.php' );
-
# Yucky hardcoding hack
switch( $wgMetaNamespace ) {
case 'Wikipedie':
@@ -109,7 +106,7 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageCs extends LanguageUtf8 {
+class LanguageCs extends Language {
function getBookstoreList () {
global $wgBookstoreListCs ;
Index: languages/LanguageSc.php
===================================================================
--- languages/LanguageSc.php (revision 14788)
+++ languages/LanguageSc.php (working copy)
@@ -4,7 +4,7 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
+require_once( "Language.php" );
/* private */ $wgNamespaceNamesSc = array(
NS_SPECIAL => 'Speciale',
@@ -26,7 +26,7 @@
require_once('MessagesSc.php');
}
-class LanguageSc extends LanguageUtf8 {
+class LanguageSc extends Language {
function getNamespaces() {
global $wgNamespaceNamesSc;
Index: languages/LanguageKm.php
===================================================================
--- languages/LanguageKm.php (revision 14788)
+++ languages/LanguageKm.php (working copy)
@@ -7,9 +7,7 @@
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageKm extends LanguageUtf8 {
+class LanguageKm extends Language {
function digitTransformTable() {
return array(
'0' => '០',
Index: languages/LanguageKo.php
===================================================================
--- languages/LanguageKo.php (revision 14788)
+++ languages/LanguageKo.php (working copy)
@@ -4,7 +4,6 @@
* @package MediaWiki
* @subpackage Language
*/
-require_once('LanguageUtf8.php');
/* private */ $wgNamespaceNamesKo = array(
NS_MEDIA => 'Media',
@@ -64,7 +63,7 @@
require_once('MessagesKo.php');
}
-class LanguageKo extends LanguageUtf8 {
+class LanguageKo extends Language {
function getBookstoreList() {
global $wgBookstoreListKo;
Index: languages/LanguageCy.php
===================================================================
--- languages/LanguageCy.php (revision 14788)
+++ languages/LanguageCy.php (working copy)
@@ -82,11 +82,8 @@
}
-/** */
-require_once( 'LanguageUtf8.php' );
-
/** @package MediaWiki */
-class LanguageCy extends LanguageUtf8 {
+class LanguageCy extends Language {
function getBookstoreList () {
global $wgBookstoreListCy;
Index: languages/LanguageKs.php
===================================================================
--- languages/LanguageKs.php (revision 14788)
+++ languages/LanguageKs.php (working copy)
@@ -5,9 +5,7 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageKs extends LanguageUtf8 {
+class LanguageKs extends Language {
#FIXME: inherit almost everything for now
function isRTL() {
Index: languages/LanguageSk.php
===================================================================
--- languages/LanguageSk.php (revision 14788)
+++ languages/LanguageSk.php (working copy)
@@ -6,13 +6,11 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesSk.php');
}
-class LanguageSk extends LanguageUtf8 {
+class LanguageSk extends Language {
private $mQuickbarSettingsSk = array(
'Žiadne', 'Ukotvené vľavo', 'Ukotvené vpravo', 'Plávajúce vľavo'
@@ -89,7 +87,7 @@
);
function LanguageSk() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesSk;
$this->mMessagesSk =& $wgAllMessagesSk;
Index: languages/LanguageKu.php
===================================================================
--- languages/LanguageKu.php (revision 14788)
+++ languages/LanguageKu.php (working copy)
@@ -5,8 +5,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesKu = array(
NS_MEDIA => 'Medya',
NS_SPECIAL => 'Taybet',
@@ -33,7 +31,7 @@
}
-class LanguageKu extends LanguageUtf8 {
+class LanguageKu extends Language {
function getNamespaces() {
global $wgNamespaceNamesKu;
return $wgNamespaceNamesKu;
Index: languages/LanguageOr.php
===================================================================
--- languages/LanguageOr.php (revision 14788)
+++ languages/LanguageOr.php (working copy)
@@ -7,10 +7,8 @@
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
*/
-require_once( 'LanguageUtf8.php' );
+class LanguageOr extends Language {
-class LanguageOr extends LanguageUtf8 {
-
function digitTransformTable() {
return array(
'0' => '୦',
Index: languages/LanguageSq.php
===================================================================
--- languages/LanguageSq.php (revision 14788)
+++ languages/LanguageSq.php (working copy)
@@ -5,13 +5,11 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesSq.php');
}
-class LanguageSq extends LanguageUtf8 {
+class LanguageSq extends Language {
private $mMessagesSq, $mNamespaceNamesSq = null;
private $mQuickbarSettingsSq = array(
@@ -31,7 +29,7 @@
);
function LanguageSq() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesSq;
$this->mMessagesSq =& $wgAllMessagesSq;
Index: languages/LanguageNds.php
===================================================================
--- languages/LanguageNds.php (revision 14788)
+++ languages/LanguageNds.php (working copy)
@@ -6,7 +6,6 @@
#
# Low Saxon (Plattdüütsch) localisation for MediaWiki
#
-require_once( 'LanguageUtf8.php' );
/* private */ $wgNamespaceNamesNds = array(
NS_MEDIA => 'Media',
@@ -95,7 +94,7 @@
require_once('MessagesNds.php');
}
-class LanguageNds extends LanguageUtf8 {
+class LanguageNds extends Language {
function getBookstoreList() {
global $wgBookstoreListNds;
Index: languages/LanguageTlh.php
===================================================================
--- languages/LanguageTlh.php (revision 14788)
+++ languages/LanguageTlh.php (working copy)
@@ -5,8 +5,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesTlh = array(
NS_MEDIA => "Doch",
NS_SPECIAL => "le'",
@@ -28,7 +26,7 @@
NS_CATEGORY_TALK => "Segh_ja'chuq"
) + $wgNamespaceNamesEn;
-class LanguageTlh extends LanguageUtf8 {
+class LanguageTlh extends Language {
function getNamespaces() {
global $wgNamespaceNamesTlh;
return $wgNamespaceNamesTlh;
Index: languages/LanguageSu.php
===================================================================
--- languages/LanguageSu.php (revision 14788)
+++ languages/LanguageSu.php (working copy)
@@ -7,8 +7,6 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesSu = array(
NS_MEDIA => 'Média',
NS_SPECIAL => 'Husus',
@@ -34,7 +32,7 @@
require_once('MessagesSu.php');
}
-class LanguageSu extends LanguageUtf8 {
+class LanguageSu extends Language {
function getNamespaces() {
global $wgNamespaceNamesSu;
Index: languages/LanguageHe.php
===================================================================
--- languages/LanguageHe.php (revision 14788)
+++ languages/LanguageHe.php (working copy)
@@ -9,13 +9,11 @@
* @author Rotem Liss (March 2006 on)
*/
-require_once("LanguageUtf8.php");
-
if (!$wgCachedMessageArrays) {
require_once('MessagesHe.php');
}
-class LanguageHe extends LanguageUtf8 {
+class LanguageHe extends Language {
private $mMessagesHe, $mNamespaceNamesHe = null;
private $mSkinNamesHe = array(
@@ -45,7 +43,7 @@
* Constructor, setting the namespaces
*/
function LanguageHe() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesHe;
$this->mMessagesHe = &$wgAllMessagesHe;
Index: languages/LanguagePa.php
===================================================================
--- languages/LanguagePa.php (revision 14788)
+++ languages/LanguagePa.php (working copy)
@@ -8,8 +8,6 @@
#
# See: http://bugzilla.wikimedia.org/show_bug.cgi?id=1478
-require_once('LanguageUtf8.php');
-
/* private */ $wgNamespaceNamesPa = array(
NS_MEDIA => 'ਮੀਡੀਆ',
NS_SPECIAL => 'ਖਾਸ',
@@ -47,7 +45,7 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguagePa extends LanguageUtf8 {
+class LanguagePa extends Language {
function getNamespaces() {
global $wgNamespaceNamesPa;
Index: languages/LanguageHi.php
===================================================================
--- languages/LanguageHi.php (revision 14788)
+++ languages/LanguageHi.php (working copy)
@@ -4,8 +4,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesHi = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'विशेष',
@@ -30,7 +28,7 @@
}
-class LanguageHi extends LanguageUtf8 {
+class LanguageHi extends Language {
function digitTransformTable() {
return array(
"0" => "०",
Index: languages/LanguageDv.php
===================================================================
--- languages/LanguageDv.php (revision 14788)
+++ languages/LanguageDv.php (working copy)
@@ -5,9 +5,7 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageDv extends LanguageUtf8 {
+class LanguageDv extends Language {
#FIXME: inherit almost everything for now
function isRTL() {
Index: languages/LanguageTh.php
===================================================================
--- languages/LanguageTh.php (revision 14788)
+++ languages/LanguageTh.php (working copy)
@@ -42,10 +42,8 @@
# Internationalisation code
#--------------------------------------------------------------------------
-require_once( "LanguageUtf8.php" );
+class LanguageTh extends Language {
-class LanguageTh extends LanguageUtf8 {
-
function getNamespaces() {
global $wgNamespaceNamesTh;
return $wgNamespaceNamesTh;
Index: languages/LanguageHu.php
===================================================================
--- languages/LanguageHu.php (revision 14788)
+++ languages/LanguageHu.php (working copy)
@@ -7,8 +7,6 @@
# Hungarian localisation for MediaWiki
#
-require_once("LanguageUtf8.php");
-
# suffixed project name (Wikipédia -> Wikipédiá) -- ról, ba, k
$wgSitenameROL = $wgSitename . "ról";
$wgSitenameBA = $wgSitename . "ba";
@@ -75,7 +73,7 @@
require_once('MessagesHu.php');
}
-class LanguageHu extends LanguageUtf8 {
+class LanguageHu extends Language {
function getNamespaces() {
global $wgNamespaceNamesHu;
Index: languages/LanguageDz.php
===================================================================
--- languages/LanguageDz.php (revision 14788)
+++ languages/LanguageDz.php (working copy)
@@ -7,9 +7,7 @@
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageDz extends LanguageUtf8 {
+class LanguageDz extends Language {
function digitTransformTable() {
return array(
'0' => '༠',
Index: languages/LanguageLt.php
===================================================================
--- languages/LanguageLt.php (revision 14788)
+++ languages/LanguageLt.php (working copy)
@@ -4,8 +4,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesLt = array(
NS_MEDIA => 'Medija',
NS_SPECIAL => 'Specialus',
@@ -50,7 +48,7 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageLt extends LanguageUtf8 {
+class LanguageLt extends Language {
# Inherent default user options unless customization is desired
function getQuickbarSettings() {
Index: languages/LanguagePs.php
===================================================================
--- languages/LanguagePs.php (revision 14788)
+++ languages/LanguagePs.php (working copy)
@@ -6,10 +6,8 @@
# Stub for Pashto
-require_once( "LanguageUtf8.php" );
+class LanguagePs extends Language {
-class LanguagePs extends LanguageUtf8 {
-
function getDefaultUserOptions() {
$opt = Language::getDefaultUserOptions();
$opt["quickbar"] = 2; # Right-to-left
Index: languages/LanguageXal.php
===================================================================
--- languages/LanguageXal.php (revision 14788)
+++ languages/LanguageXal.php (working copy)
@@ -5,8 +5,6 @@
*/
# Kalmyk stub localization;
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesXal = array(
NS_MEDIA => 'Аһар',
NS_SPECIAL => 'Көдлхнə',
@@ -32,11 +30,11 @@
require_once('MessagesXal.php');
}
-class LanguageXal extends LanguageUtf8 {
+class LanguageXal extends Language {
function LanguageXal() {
# FIXME are the globas really used?
global $wgNamespaceNamesXal, $wgMetaNamespace;
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
}
function getNamespaces() {
Index: languages/LanguageTr.php
===================================================================
--- languages/LanguageTr.php (revision 14788)
+++ languages/LanguageTr.php (working copy)
@@ -1,5 +1,4 @@
<?php
-require_once( "LanguageUtf8.php" );
/* private */ $wgNamespaceNamesTr = array(
NS_MEDIA => 'Media',
@@ -36,9 +35,7 @@
require_once('MessagesTr.php');
}
-
-
-class LanguageTr extends LanguageUtf8 {
+class LanguageTr extends Language {
function getNamespaces() {
global $wgNamespaceNamesTr;
return $wgNamespaceNamesTr;
Index: languages/LanguageAf.php
===================================================================
--- languages/LanguageAf.php (revision 14788)
+++ languages/LanguageAf.php (working copy)
@@ -5,13 +5,11 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesAf.php');
}
-class LanguageAf extends LanguageUtf8 {
+class LanguageAf extends Language {
private $mMessagesAf, $mNamespaceNamesAf = null;
private $mQuickbarSettingsAf = array(
@@ -25,7 +23,7 @@
);
function LanguageAf() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesAf;
$this->mMessagesAf =& $wgAllMessagesAf;
Index: languages/LanguageAst.php
===================================================================
--- languages/LanguageAst.php (revision 14788)
+++ languages/LanguageAst.php (working copy)
@@ -5,13 +5,11 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageAst extends LanguageUtf8 {
+class LanguageAst extends Language {
private $mNamespaceNamesAst = null;
function LanguageAst() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgMetaNamespace;
$this->mNamespaceNamesAst = array(
Index: languages/LanguageTt.php
===================================================================
--- languages/LanguageTt.php (revision 14788)
+++ languages/LanguageTt.php (working copy)
@@ -7,8 +7,6 @@
# Tatarish localisation for MediaWiki
#
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesTt = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Maxsus',
@@ -78,7 +76,7 @@
require_once('MessagesTt.php');
}
-class LanguageTt extends LanguageUtf8 {
+class LanguageTt extends Language {
function getNamespaces() {
global $wgNamespaceNamesTt;
Index: languages/LanguageFur.php
===================================================================
--- languages/LanguageFur.php (revision 14788)
+++ languages/LanguageFur.php (working copy)
@@ -4,8 +4,6 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesFur = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Speciâl',
@@ -41,7 +39,7 @@
require_once('MessagesFur.php');
}
-class LanguageFur extends LanguageUtf8 {
+class LanguageFur extends Language {
function getNamespaces() {
global $wgNamespaceNamesFur;
Index: languages/LanguageId.php
===================================================================
--- languages/LanguageId.php (revision 14788)
+++ languages/LanguageId.php (working copy)
@@ -1,7 +1,5 @@
<?php
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesId = array(
NS_MEDIA => "Media",
NS_SPECIAL => "Istimewa",
@@ -59,7 +57,7 @@
require_once('MessagesId.php');
}
-class LanguageId extends LanguageUtf8 {
+class LanguageId extends Language {
function getBookstoreList () {
global $wgBookstoreListId;
Index: languages/LanguageAn.php
===================================================================
--- languages/LanguageAn.php (revision 14788)
+++ languages/LanguageAn.php (working copy)
@@ -5,13 +5,11 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
-class LanguageAn extends LanguageUtf8 {
+class LanguageAn extends Language {
private $mNamespaceNamesAn = null;
function LanguageAn() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgMetaNamespace;
$this->mNamespaceNamesAn = array(
Index: languages/LanguageAr.php
===================================================================
--- languages/LanguageAr.php (revision 14788)
+++ languages/LanguageAr.php (working copy)
@@ -5,9 +5,6 @@
* @subpackage Language
*/
-/** This is an UTF-8 language */
-require_once('LanguageUtf8.php');
-
/* private */ $wgNamespaceNamesAr = array(
NS_MEDIA => 'ملف',
NS_SPECIAL => 'خاص',
@@ -96,7 +93,7 @@
require_once('MessagesAr.php');
}
-class LanguageAr extends LanguageUtf8 {
+class LanguageAr extends Language {
function digitTransformTable() {
return array(
'0' => '٠',
Index: languages/LanguageEo.php
===================================================================
--- languages/LanguageEo.php (revision 14788)
+++ languages/LanguageEo.php (working copy)
@@ -4,9 +4,6 @@
* @subpackage Language
*/
-/** */
-require_once('LanguageUtf8.php');
-
/* private */ $wgNamespaceNamesEo = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Speciala',
@@ -52,7 +49,7 @@
}
/** @package MediaWiki */
-class LanguageEo extends LanguageUtf8 {
+class LanguageEo extends Language {
function getDefaultUserOptions () {
$opt = parent::getDefaultUserOptions();
Index: languages/LanguageMk.php
===================================================================
--- languages/LanguageMk.php (revision 14788)
+++ languages/LanguageMk.php (working copy)
@@ -96,9 +96,9 @@
require_once('MessagesMk.php');
}
-require_once( 'LanguageUtf8.php' );
+require_once( 'Language.php' );
-class LanguageMk extends LanguageUtf8 {
+class LanguageMk extends Language {
/**
* Exports $wgNamespaceNamesMk
* @return array
Index: languages/LanguageEs.php
===================================================================
--- languages/LanguageEs.php (revision 14788)
+++ languages/LanguageEs.php (working copy)
@@ -8,8 +8,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesEs = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Especial',
@@ -45,7 +43,7 @@
require_once('MessagesEs.php');
}
-class LanguageEs extends LanguageUtf8 {
+class LanguageEs extends Language {
function getNamespaces() {
global $wgNamespaceNamesEs;
Index: languages/LanguageEu.php
===================================================================
--- languages/LanguageEu.php (revision 14788)
+++ languages/LanguageEu.php (working copy)
@@ -6,8 +6,6 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesEu = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Aparteko',
@@ -44,7 +42,7 @@
require_once('MessagesEu.php');
}
-class LanguageEu extends LanguageUtf8 {
+class LanguageEu extends Language {
function getNamespaces() {
global $wgNamespaceNamesEu;
Index: languages/LanguageAz.php
===================================================================
--- languages/LanguageAz.php (revision 14788)
+++ languages/LanguageAz.php (working copy)
@@ -5,13 +5,11 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesAz.php');
}
-class LanguageAz extends LanguageUtf8 {
+class LanguageAz extends Language {
private $mMessagesAz, $mNamespaceNamesAz = null;
private $mDateFormatsAz = array(
@@ -23,7 +21,7 @@
);
function LanguageAz() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesAz;
$this->mMessagesAz =& $wgAllMessagesAz;
Index: languages/LanguageUg.php
===================================================================
--- languages/LanguageUg.php (revision 14788)
+++ languages/LanguageUg.php (working copy)
@@ -5,9 +5,7 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageUg extends LanguageUtf8 {
+class LanguageUg extends Language {
#FIXME: inherit almost everything for now
function isRTL() {
Index: languages/LanguageIt.php
===================================================================
--- languages/LanguageIt.php (revision 14788)
+++ languages/LanguageIt.php (working copy)
@@ -34,10 +34,8 @@
require_once('MessagesIt.php');
}
-require_once( "LanguageUtf8.php" );
+class LanguageIt extends Language {
-class LanguageIt extends LanguageUtf8 {
-
function getNamespaces() {
global $wgNamespaceNamesIt;
return $wgNamespaceNamesIt;
Index: languages/LanguageMs.php
===================================================================
--- languages/LanguageMs.php (revision 14788)
+++ languages/LanguageMs.php (working copy)
@@ -41,10 +41,8 @@
require_once('MessagesMs.php');
}
-require_once( "LanguageUtf8.php" );
+class LanguageMs extends Language {
-class LanguageMs extends LanguageUtf8 {
-
function getNamespaces() {
global $wgNamespaceNamesMs;
return $wgNamespaceNamesMs;
Index: languages/LanguageUk.php
===================================================================
--- languages/LanguageUk.php (revision 14788)
+++ languages/LanguageUk.php (working copy)
@@ -4,8 +4,6 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesUk = array(
NS_MEDIA => 'Медіа',
NS_SPECIAL => 'Спеціальні',
@@ -46,7 +44,7 @@
require_once('MessagesUk.php');
}
-class LanguageUk extends LanguageUtf8 {
+class LanguageUk extends Language {
function getNamespaces() {
global $wgNamespaceNamesUk;
Index: languages/LanguageTyv.php
===================================================================
--- languages/LanguageTyv.php (revision 14788)
+++ languages/LanguageTyv.php (working copy)
@@ -7,8 +7,6 @@
# From friends at tyvawiki.org
# Originally based upon LanguageRu.php
-require_once( 'LanguageUtf8.php' );
-
#--------------------------------------------------------------------------
# Language-specific text
#--------------------------------------------------------------------------
@@ -64,10 +62,10 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageTyv extends LanguageUtf8 {
+class LanguageTyv extends Language {
function LanguageTyv() {
global $wgNamespaceNamesTyv, $wgMetaNamespace;
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
$wgNamespaceNamesTyv[NS_PROJECT_TALK] = $wgMetaNamespace . '_чугаа';
}
Index: languages/LanguageUdm.php
===================================================================
--- languages/LanguageUdm.php (revision 14788)
+++ languages/LanguageUdm.php (working copy)
@@ -38,7 +38,7 @@
function LanguageUdm() {
# FIXME are the globals really used?
global $wgNamespaceNamesUdm, $wgMetaNamespace;
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
}
function getNamespaces() {
Index: languages/LanguageBe.php
===================================================================
--- languages/LanguageBe.php (revision 14788)
+++ languages/LanguageBe.php (working copy)
@@ -11,13 +11,11 @@
* @license http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License
*/
-require_once('LanguageUtf8.php');
-
if (!$wgCachedMessageArrays) {
require_once('MessagesBe.php');
}
-class LanguageBe extends LanguageUtf8 {
+class LanguageBe extends Language {
private $mMessagesBe, $mNamespaceNamesBe = null;
private $mQuickbarSettingsBe = array(
@@ -121,7 +119,7 @@
);
function LanguageBe() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesBe;
$this->mMessagesBe =& $wgAllMessagesBe;
Index: languages/LanguageBg.php
===================================================================
--- languages/LanguageBg.php (revision 14788)
+++ languages/LanguageBg.php (working copy)
@@ -100,14 +100,11 @@
require_once('MessagesBg.php');
}
-/** This is an UTF-8 language */
-require_once( 'LanguageUtf8.php' );
-
/**
* @package MediaWiki
* @subpackage Language
*/
-class LanguageBg extends LanguageUtf8 {
+class LanguageBg extends Language {
/**
* Exports $wgBookstoreListBg
Index: languages/LanguageJa.php
===================================================================
--- languages/LanguageJa.php (revision 14788)
+++ languages/LanguageJa.php (working copy)
@@ -6,13 +6,11 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesJa.php');
}
-class LanguageJa extends LanguageUtf8 {
+class LanguageJa extends Language {
private $mMessagesJa, $mNamespaceNamesJa = null;
private $mQuickbarSettingsJa = array(
@@ -35,7 +33,7 @@
);
function LanguageJa() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesJa;
$this->mMessagesJa =& $wgAllMessagesJa;
@@ -159,7 +157,7 @@
$s = preg_replace( '/\xef\xbd([\x80-\x99])/e', 'chr((ord("$1") & 0x3f) + 0x60)', $s );
# Do general case folding and UTF-8 armoring
- return LanguageUtf8::stripForSearch( $s );
+ return parent::stripForSearch( $s );
}
# Italic is not appropriate for Japanese script
Index: languages/LanguageBo.php
===================================================================
--- languages/LanguageBo.php (revision 14788)
+++ languages/LanguageBo.php (working copy)
@@ -7,10 +7,8 @@
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
*/
-require_once( 'LanguageUtf8.php' );
+class LanguageBo extends Language {
-class LanguageBo extends LanguageUtf8 {
-
function getAllMessages() {
return null;
}
Index: languages/LanguageBs.php
===================================================================
--- languages/LanguageBs.php (revision 14788)
+++ languages/LanguageBs.php (working copy)
@@ -5,8 +5,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesBs = array(
NS_MEDIA => "Medija",
NS_SPECIAL => "Posebno",
@@ -124,10 +122,10 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageBs extends LanguageUtf8 {
+class LanguageBs extends Language {
function LanguageBs() {
global $wgNamespaceNamesBs, $wgMetaNamespace;
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
$wgNamespaceNamesBs[NS_PROJECT_TALK] = 'Razgovor_' .
str_replace( ' ', '_',
$this->convertGrammar( $wgMetaNamespace, 'instrumental' ) );
Index: languages/LanguagePt_br.php
===================================================================
--- languages/LanguagePt_br.php (revision 14788)
+++ languages/LanguagePt_br.php (working copy)
@@ -4,7 +4,6 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
/** Inherit some stuff from Portuguese: */
require_once( 'LanguagePt.php' );
#
Index: languages/LanguageConverter.php
===================================================================
--- languages/LanguageConverter.php (revision 14788)
+++ languages/LanguageConverter.php (working copy)
@@ -596,7 +596,7 @@
if ($this->mUcfirst) {
foreach ($ret as $k => $v) {
- $ret[LanguageUtf8::ucfirst($k)] = LanguageUtf8::ucfirst($v);
+ $ret[Language::ucfirst($k)] = Language::ucfirst($v);
}
}
return $ret;
Index: languages/LanguageFr.php
===================================================================
--- languages/LanguageFr.php (revision 14788)
+++ languages/LanguageFr.php (working copy)
@@ -4,8 +4,6 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesFr = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Special',
@@ -49,7 +47,7 @@
require_once('MessagesFr.php');
}
-class LanguageFr extends LanguageUtf8 {
+class LanguageFr extends Language {
function getBookstoreList () {
global $wgBookstoreListFr ;
Index: languages/LanguageNl.php
===================================================================
--- languages/LanguageNl.php (revision 14788)
+++ languages/LanguageNl.php (working copy)
@@ -5,13 +5,11 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesNl.php');
}
-class LanguageNl extends LanguageUtf8 {
+class LanguageNl extends Language {
private $mMessagesNl, $mNamespaceNamesNl = null;
private $mQuickbarSettingsNl = array(
@@ -25,7 +23,7 @@
);
function LanguageNl() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesNl;
$this->mMessagesNl =& $wgAllMessagesNl;
Index: languages/LanguageNn.php
===================================================================
--- languages/LanguageNn.php (revision 14788)
+++ languages/LanguageNn.php (working copy)
@@ -13,8 +13,6 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesNn = array(
NS_MEDIA => 'Filpeikar',
NS_SPECIAL => 'Spesial',
@@ -121,7 +119,7 @@
require_once('MessagesNn.php');
}
-class LanguageNn extends LanguageUtf8 {
+class LanguageNn extends Language {
function getNamespaces() {
global $wgNamespaceNamesNn;
Index: languages/LanguageRo.php
===================================================================
--- languages/LanguageRo.php (revision 14788)
+++ languages/LanguageRo.php (working copy)
@@ -5,13 +5,11 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesRo.php');
}
-class LanguageRo extends LanguageUtf8 {
+class LanguageRo extends Language {
private $mMessagesRo, $mNamespaceNamesRo = null;
private $mQuickbarSettingsRo = array(
@@ -51,7 +49,7 @@
function LanguageRo() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesRo;
$this->mMessagesRo =& $wgAllMessagesRo;
Index: languages/LanguageNv.php
===================================================================
--- languages/LanguageNv.php (revision 14788)
+++ languages/LanguageNv.php (working copy)
@@ -7,8 +7,6 @@
# Navajo language file
# No messages at the moment, just all the other stuff
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesNv = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Special',
@@ -61,7 +59,7 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageNv extends LanguageUtf8 {
+class LanguageNv extends Language {
function getNamespaces() {
global $wgNamespaceNamesNv;
Index: languages/LanguageRu.php
===================================================================
--- languages/LanguageRu.php (revision 14788)
+++ languages/LanguageRu.php (working copy)
@@ -7,9 +7,6 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
-
/* private */ $wgNamespaceNamesRu = array(
NS_MEDIA => 'Медиа',
NS_SPECIAL => 'Служебная',
@@ -115,10 +112,10 @@
}
/* Please, see Language.php for general function comments */
-class LanguageRu extends LanguageUtf8 {
+class LanguageRu extends Language {
function LanguageRu() {
global $wgNamespaceNamesRu, $wgMetaNamespace;
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
$wgNamespaceNamesRu[NS_PROJECT_TALK] = 'Обсуждение_' . $this->convertGrammar( $wgMetaNamespace, 'genitive' );
}
Index: languages/LanguageGa.php
===================================================================
--- languages/LanguageGa.php (revision 14788)
+++ languages/LanguageGa.php (working copy)
@@ -101,12 +101,10 @@
require_once('MessagesGa.php');
}
-require_once( "LanguageUtf8.php" );
-
-class LanguageGa extends LanguageUtf8 {
+class LanguageGa extends Language {
function LanguageGa() {
global $wgNamespaceNamesGa, $wgMetaNamespace;
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
$wgNamespaceNamesGa[NS_PROJECT_TALK] = 'Plé_' . $this->convertGrammar( $wgMetaNamespace, 'genitive' );
}
Index: languages/LanguageOc.php
===================================================================
--- languages/LanguageOc.php (revision 14788)
+++ languages/LanguageOc.php (working copy)
@@ -5,13 +5,11 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesOc.php');
}
-class LanguageOc extends LanguageUtf8 {
+class LanguageOc extends Language {
private $mMessagesOc, $mNamespaceNamesOc;
private $mQuickbarSettingsOc = array(
@@ -29,7 +27,7 @@
);
function LanguageOc() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesOc;
$this->mMessagesOc =& $wgAllMessagesOc;
Index: languages/LanguageZh_cn.php
===================================================================
--- languages/LanguageZh_cn.php (revision 14788)
+++ languages/LanguageZh_cn.php (working copy)
@@ -3,7 +3,6 @@
* @package MediaWiki
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
/* private */ $wgNamespaceNamesZh_cn = array(
NS_MEDIA => 'Media',
@@ -50,7 +49,7 @@
}
-class LanguageZh_cn extends LanguageUtf8 {
+class LanguageZh_cn extends Language {
function getUserToggles() {
global $wgUserTogglesZh_cn;
Index: languages/LanguageSr_el.php
===================================================================
--- languages/LanguageSr_el.php (revision 14788)
+++ languages/LanguageSr_el.php (working copy)
@@ -4,8 +4,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesSr_el = array(
NS_MEDIA => "Medija",
NS_SPECIAL => "Posebno",
@@ -123,7 +121,7 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageSr_el extends LanguageUtf8 {
+class LanguageSr_el extends Language {
function getNamespaces() {
global $wgNamespaceNamesSr_el;
Index: languages/LanguageSd.php
===================================================================
--- languages/LanguageSd.php (revision 14788)
+++ languages/LanguageSd.php (working copy)
@@ -5,9 +5,7 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageSd extends LanguageUtf8 {
+class LanguageSd extends Language {
#FIXME: inherit almost everything for now
function isRTL() {
Index: languages/LanguageWa.php
===================================================================
--- languages/LanguageWa.php (revision 14788)
+++ languages/LanguageWa.php (working copy)
@@ -6,8 +6,6 @@
* @subpackage Language
*/
-require_once( "LanguageUtf8.php" );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesWa.php');
}
@@ -18,7 +16,7 @@
define( 'MW_DATE_WLN_LONG', MW_DATE_DMY );
define( 'MW_DATE_WLN_SHORT', '4' );
-class LanguageWa extends LanguageUtf8 {
+class LanguageWa extends Language {
private $mMessagesWa, $mNamespaceNamesWa = null;
private $mQuickbarSettingsWa = array(
@@ -42,7 +40,7 @@
function LanguageWa() {
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
global $wgAllMessagesWa;
$this->mMessagesWa =& $wgAllMessagesWa;
Index: languages/LanguageKn.php
===================================================================
--- languages/LanguageKn.php (revision 14788)
+++ languages/LanguageKn.php (working copy)
@@ -14,13 +14,11 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
if (!$wgCachedMessageArrays) {
require_once('MessagesKn.php');
}
-class LanguageKn extends LanguageUtf8 {
+class LanguageKn extends Language {
function digitTransformTable() {
return array(
'0' => '೦',
Index: languages/LanguageCv.php
===================================================================
--- languages/LanguageCv.php (revision 14788)
+++ languages/LanguageCv.php (working copy)
@@ -40,7 +40,7 @@
class LanguageCv extends LanguageRu {
function LanguageCv() {
global $wgNamespaceNamesCv, $wgMetaNamespace;
- LanguageUtf8::LanguageUtf8();
+ Language::Language();
}
function getNamespaces() {
Index: languages/LanguageGu.php
===================================================================
--- languages/LanguageGu.php (revision 14788)
+++ languages/LanguageGu.php (working copy)
@@ -4,9 +4,7 @@
* @subpackage Language
*/
-require_once( 'LanguageUtf8.php' );
-
-class LanguageGu extends LanguageUtf8 {
+class LanguageGu extends Language {
function digitTransformTable() {
return array(
'0' => '૦',
Index: languages/LanguageSl.php
===================================================================
--- languages/LanguageSl.php (revision 14788)
+++ languages/LanguageSl.php (working copy)
@@ -18,8 +18,6 @@
# 1.00.50 Nikerabbit 2005-08-15 | removed old stuff, some cleanup, NOT COMPLETE!
-require_once( "LanguageUtf8.php" );
-
/* private */ $wgNamespaceNamesSl = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Posebno',
@@ -57,10 +55,10 @@
# Internationalisation code
#--------------------------------------------------------------------------
-class LanguageSl extends LanguageUtf8 {
+class LanguageSl extends Language {
function LanguageSl() {
global $wgNamespaceNamesSl, $wgMetaNamespace;
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
$wgNamespaceNamesSl[NS_PROJECT_TALK] = 'Pogovor_' .
str_replace( ' ', '_', $this->convertGrammar( $wgMetaNamespace, 'mestnik' ) );
}
Index: languages/LanguageOs.php
===================================================================
--- languages/LanguageOs.php (revision 14788)
+++ languages/LanguageOs.php (working copy)
@@ -52,7 +52,7 @@
function LanguageOs() {
# FIXME: Are the globals really used ?
global $wgNamespaceNamesOs, $wgMetaNamespace;
- LanguageUtf8::LanguageUtf8();
+ parent::Language();
}
function getNamespaces() {
Index: languages/LanguageDa.php
===================================================================
--- languages/LanguageDa.php (revision 14788)
+++ languages/LanguageDa.php (working copy)
@@ -5,9 +5,6 @@
* @subpackage Language
*/
-/** */
-require_once( 'LanguageUtf8.php' );
-
/* private */ $wgNamespaceNamesDa = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Speciel',
@@ -53,7 +50,7 @@
}
/** @package MediaWiki */
-class LanguageDa extends LanguageUtf8 {
+class LanguageDa extends Language {
function getBookstoreList () {
global $wgBookstoreListDa ;
Index: includes/Setup.php
===================================================================
--- includes/Setup.php (revision 14788)
+++ includes/Setup.php (working copy)
@@ -169,7 +169,7 @@
if( ! class_exists( $langclass ) ) {
# Default to English/UTF-8
- $baseclass = 'LanguageUtf8';
+ $baseclass = 'Language';
require_once( "$IP/languages/$baseclass.php" );
$lc = strtolower(substr($langclass, 8));
$snip = "
Index: includes/SpecialVersion.php
===================================================================
--- includes/SpecialVersion.php (revision 14788)
+++ includes/SpecialVersion.php (working copy)
@@ -142,7 +142,7 @@
if ( $a['name'] === $b['name'] )
return 0;
else
- return LanguageUtf8::lc( $a['name'] ) > LanguageUtf8::lc( $b['name'] ) ? 1 : -1;
+ return Language::lc( $a['name'] ) > Language::lc( $b['name'] ) ? 1 : -1;
}
function formatCredits( $name, $version = null, $author = null, $url = null, $description = null) {

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1571
Default Alt Text
patch (67 KB)

Event Timeline