MediaWiki  1.23.12
Go to the documentation of this file.
1 <?php
29 class LanguageZh_hans extends Language {
34  function hasWordBreaks() {
35  return false;
36  }
47  function segmentByWord( $string ) {
48  $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
49  $s = self::insertSpace( $string, $reg );
50  return $s;
51  }
57  function normalizeForSearch( $s ) {
58  wfProfileIn( __METHOD__ );
60  // Double-width roman characters
61  $s = parent::normalizeForSearch( $s );
62  $s = trim( $s );
63  $s = $this->segmentByWord( $s );
65  wfProfileOut( __METHOD__ );
66  return $s;
67  }
79  public function formatDuration( $seconds, array $chosenIntervals = array() ) {
80  if ( empty( $chosenIntervals ) ) {
81  $chosenIntervals = array( 'centuries', 'years', 'days', 'hours', 'minutes', 'seconds' );
82  }
84  $intervals = $this->getDurationIntervals( $seconds, $chosenIntervals );
86  $segments = array();
88  foreach ( $intervals as $intervalName => $intervalValue ) {
89  // Messages: duration-seconds, duration-minutes, duration-hours, duration-days, duration-weeks,
90  // duration-years, duration-decades, duration-centuries, duration-millennia
91  $message = wfMessage( 'duration-' . $intervalName )->numParams( $intervalValue );
92  $segments[] = $message->inLanguage( $this )->escaped();
93  }
95  return implode( '', $segments );
96  }
97 }
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
getDurationIntervals( $seconds, array $chosenIntervals=array())
Takes a number of seconds and returns an array with a set of corresponding intervals.
Definition: Language.php:2134
Definition: LanguageZh_hans.php:34
wfProfileIn( $functionname)
Begin profiling of a function.
Definition: Profiler.php:33
Definition: mergeMessageFileList.php:156
normalizeForSearch( $s)
Definition: LanguageZh_hans.php:57
wfProfileOut( $functionname='missing')
Stop profiling of a function.
Definition: Profiler.php:46
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
Simplified Chinese.
Definition: LanguageZh_hans.php:29
formatDuration( $seconds, array $chosenIntervals=array())
Takes a number of seconds and turns it into a text using values such as hours and minutes.
Definition: LanguageZh_hans.php:79
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
static insertSpace( $string, $pattern)
Definition: Language.php:2707
Internationalisation code.
Definition: Language.php:74
segmentByWord( $string)
Eventually this should be a word segmentation; for now just treat each character as a word.
Definition: LanguageZh_hans.php:47