summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageGan.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
commitca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch)
treeec04cc15b867bc21eedca904cea9af0254531a11 /languages/classes/LanguageGan.php
parenta22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff)
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing
Diffstat (limited to 'languages/classes/LanguageGan.php')
-rw-r--r--languages/classes/LanguageGan.php47
1 files changed, 42 insertions, 5 deletions
diff --git a/languages/classes/LanguageGan.php b/languages/classes/LanguageGan.php
index da5e1d22..99b4c29e 100644
--- a/languages/classes/LanguageGan.php
+++ b/languages/classes/LanguageGan.php
@@ -8,6 +8,14 @@ require_once( dirname( __FILE__ ) . '/LanguageZh.php' );
*/
class GanConverter extends LanguageConverter {
+ /**
+ * @param $langobj Language
+ * @param $maincode string
+ * @param $variants array
+ * @param $variantfallbacks array
+ * @param $flags array
+ * @param $manualLevel array
+ */
function __construct( $langobj, $maincode,
$variants = array(),
$variantfallbacks = array(),
@@ -37,14 +45,24 @@ class GanConverter extends LanguageConverter {
);
}
- /* there shouldn't be any latin text in Chinese conversion, so no need
- to mark anything.
- $noParse is there for compatibility with LanguageConvert::markNoConversion
+ /**
+ * there shouldn't be any latin text in Chinese conversion, so no need
+ * to mark anything.
+ * $noParse is there for compatibility with LanguageConvert::markNoConversion
+ *
+ * @param $text string
+ * @param $noParse bool
+ *
+ * @return string
*/
function markNoConversion( $text, $noParse = false ) {
return $text;
}
+ /**
+ * @param $key string
+ * @return String
+ */
function convertCategoryKey( $key ) {
return $this->autoConvert( $key, 'gan' );
}
@@ -80,25 +98,44 @@ class LanguageGan extends LanguageZh {
$wgHooks['ArticleSaveComplete'][] = $this->mConverter;
}
- # this should give much better diff info
+ /**
+ * this should give much better diff info
+ *
+ * @param $text string
+ * @return string
+ */
function segmentForDiff( $text ) {
return preg_replace(
"/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
"' ' .\"$1\"", $text );
}
+ /**
+ * @param $text string
+ * @return string
+ */
function unsegmentForDiff( $text ) {
return preg_replace(
"/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e",
"\"$1\"", $text );
}
- // word segmentation
+ /**
+ * word segmentation
+ *
+ * @param $string string
+ * @param $autoVariant string
+ * @return String
+ */
function normalizeForSearch( $string, $autoVariant = 'gan-hans' ) {
// LanguageZh::normalizeForSearch
return parent::normalizeForSearch( $string, $autoVariant );
}
+ /**
+ * @param $termsArray array
+ * @return array
+ */
function convertForSearchResult( $termsArray ) {
$terms = implode( '|', $termsArray );
$terms = self::convertDoubleWidth( $terms );