2004-04-09 01:04:53 +00:00
|
|
|
<?php
|
2005-07-05 21:22:25 +00:00
|
|
|
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
/** Esperanto (Esperanto)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup Language
|
|
|
|
|
*/
|
2006-07-26 07:15:39 +00:00
|
|
|
class LanguageEo extends Language {
|
2003-04-14 23:10:40 +00:00
|
|
|
function iconv( $in, $out, $string ) {
|
|
|
|
|
# Por multaj lingvoj, ĉi tiu nur voku la sisteman funkcion iconv()
|
|
|
|
|
# Ni ankaŭ konvertu X-sistemajn surogotajn
|
2005-07-06 20:04:05 +00:00
|
|
|
if( strcasecmp( $in, 'x' ) == 0 and strcasecmp( $out, 'utf-8' ) == 0) {
|
2003-04-14 23:10:40 +00:00
|
|
|
$xu = array (
|
2005-07-06 20:04:05 +00:00
|
|
|
'xx' => 'x' , 'xX' => 'x' ,
|
|
|
|
|
'Xx' => 'X' , 'XX' => 'X' ,
|
2003-04-14 23:10:40 +00:00
|
|
|
"Cx" => "\xc4\x88" , "CX" => "\xc4\x88" ,
|
|
|
|
|
"cx" => "\xc4\x89" , "cX" => "\xc4\x89" ,
|
|
|
|
|
"Gx" => "\xc4\x9c" , "GX" => "\xc4\x9c" ,
|
|
|
|
|
"gx" => "\xc4\x9d" , "gX" => "\xc4\x9d" ,
|
|
|
|
|
"Hx" => "\xc4\xa4" , "HX" => "\xc4\xa4" ,
|
|
|
|
|
"hx" => "\xc4\xa5" , "hX" => "\xc4\xa5" ,
|
|
|
|
|
"Jx" => "\xc4\xb4" , "JX" => "\xc4\xb4" ,
|
|
|
|
|
"jx" => "\xc4\xb5" , "jX" => "\xc4\xb5" ,
|
|
|
|
|
"Sx" => "\xc5\x9c" , "SX" => "\xc5\x9c" ,
|
|
|
|
|
"sx" => "\xc5\x9d" , "sX" => "\xc5\x9d" ,
|
|
|
|
|
"Ux" => "\xc5\xac" , "UX" => "\xc5\xac" ,
|
|
|
|
|
"ux" => "\xc5\xad" , "uX" => "\xc5\xad"
|
|
|
|
|
) ;
|
|
|
|
|
return preg_replace ( '/([cghjsu]x?)((?:xx)*)(?!x)/ei',
|
|
|
|
|
'strtr( "$1", $xu ) . strtr( "$2", $xu )', $string );
|
2005-07-06 20:04:05 +00:00
|
|
|
} else if( strcasecmp( $in, 'UTF-8' ) == 0 and strcasecmp( $out, 'x' ) == 0 ) {
|
2003-04-14 23:10:40 +00:00
|
|
|
$ux = array (
|
2005-07-06 20:04:05 +00:00
|
|
|
'x' => 'xx' , 'X' => 'Xx' ,
|
2003-04-14 23:10:40 +00:00
|
|
|
"\xc4\x88" => "Cx" , "\xc4\x89" => "cx" ,
|
|
|
|
|
"\xc4\x9c" => "Gx" , "\xc4\x9d" => "gx" ,
|
|
|
|
|
"\xc4\xa4" => "Hx" , "\xc4\xa5" => "hx" ,
|
|
|
|
|
"\xc4\xb4" => "Jx" , "\xc4\xb5" => "jx" ,
|
|
|
|
|
"\xc5\x9c" => "Sx" , "\xc5\x9d" => "sx" ,
|
|
|
|
|
"\xc5\xac" => "Ux" , "\xc5\xad" => "ux"
|
|
|
|
|
) ;
|
|
|
|
|
# Double Xs only if they follow cxapelutaj literoj.
|
|
|
|
|
return preg_replace( '/((?:[cghjsu]|\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]'.
|
|
|
|
|
'|\xc5[\x9c\x9d\xac\xad])x*)/ei', 'strtr( "$1", $ux )', $string );
|
|
|
|
|
}
|
2009-07-07 09:56:53 +00:00
|
|
|
return parent::iconv( $in, $out, $string );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function checkTitleEncoding( $s ) {
|
2004-11-21 07:36:46 +00:00
|
|
|
# Check for X-system backwards-compatibility URLs
|
2003-04-14 23:10:40 +00:00
|
|
|
$ishigh = preg_match( '/[\x80-\xff]/', $s);
|
|
|
|
|
$isutf = preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
|
|
|
|
|
'[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s );
|
2005-08-15 19:27:58 +00:00
|
|
|
|
2003-04-14 23:10:40 +00:00
|
|
|
if($ishigh and !$isutf) {
|
|
|
|
|
# Assume Latin1
|
|
|
|
|
$s = utf8_encode( $s );
|
|
|
|
|
} else {
|
|
|
|
|
if( preg_match( '/(\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]'.
|
|
|
|
|
'|\xc5[\x9c\x9d\xac\xad])/', $s ) )
|
|
|
|
|
return $s;
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-13 01:57:28 +00:00
|
|
|
//if( preg_match( '/[cghjsu]x/i', $s ) )
|
|
|
|
|
// return $this->iconv( 'x', 'utf-8', $s );
|
2003-04-14 23:10:40 +00:00
|
|
|
return $s;
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-14 02:00:53 +00:00
|
|
|
function initEncoding() {
|
2006-07-26 07:15:39 +00:00
|
|
|
global $wgEditEncoding;
|
2005-07-06 20:04:05 +00:00
|
|
|
$wgEditEncoding = 'x';
|
2005-03-14 02:00:53 +00:00
|
|
|
}
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|