<?php
+/**
+ * Esperanto (Esperanto) specific code.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @author Brion Vibber <brion@pobox.com>
+ * @ingroup Language
+ */
-/** Esperanto (Esperanto)
+/**
+ * Esperanto (Esperanto)
*
* @ingroup Language
- * @author Brion Vibber <brion@pobox.com>
*/
class LanguageEo extends Language {
/**
*
* In the long run, this should be moved out of here and into the client-side
* editor behavior; the original server-side translation system dates to 2002-2003
- * when many browsers will really bad Unicode support were still in use.
+ * when many browsers with really bad Unicode support were still in use.
*
* @param string $in input character set
* @param string $out output character set
if ( strcasecmp( $in, 'x' ) == 0 && strcasecmp( $out, 'utf-8' ) == 0 ) {
return preg_replace_callback (
'/([cghjsu]x?)((?:xx)*)(?!x)/i',
- 'strrtxuCallback', $string );
- } else if ( strcasecmp( $in, 'UTF-8' ) == 0 && strcasecmp( $out, 'x' ) == 0 ) {
+ array( $this, 'strrtxuCallback' ), $string );
+ } elseif ( strcasecmp( $in, 'UTF-8' ) == 0 && strcasecmp( $out, 'x' ) == 0 ) {
# Double Xs only if they follow cxapelutaj literoj.
return preg_replace_callback(
- '/((?:[cghjsu]|\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]|\xc5[\x9c\x9d\xac\xad])x*)/ei',
- 'strrtuxCallback', $string );
+ '/((?:[cghjsu]|\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]|\xc5[\x9c\x9d\xac\xad])x*)/i',
+ array( $this, 'strrtuxCallback' ), $string );
}
return parent::iconv( $in, $out, $string );
}
+ /**
+ * @param $matches array
+ * @return string
+ */
function strrtuxCallback( $matches ) {
static $ux = array (
'x' => 'xx' , 'X' => 'Xx' ,
return strtr( $matches[1], $ux );
}
+ /**
+ * @param $matches array
+ * @return string
+ */
function strrtxuCallback( $matches ) {
static $xu = array (
'xx' => 'x' , 'xX' => 'x' ,
return strtr( $matches[1], $xu ) . strtr( $matches[2], $xu );
}
+ /**
+ * @param $s string
+ * @return string
+ */
function checkTitleEncoding( $s ) {
# Check for X-system backwards-compatibility URLs
$ishigh = preg_match( '/[\x80-\xff]/', $s );