MediaWiki REL1_33
LanguageZh_hans.php
Go to the documentation of this file.
1<?php
29// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
34 function hasWordBreaks() {
35 return false;
36 }
37
47 function segmentByWord( $string ) {
48 $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
49 $s = self::insertSpace( $string, $reg );
50 return $s;
51 }
52
57 function normalizeForSearch( $s ) {
58 // Double-width roman characters
59 $s = parent::normalizeForSearch( $s );
60 $s = trim( $s );
61 $s = $this->segmentByWord( $s );
62
63 return $s;
64 }
65
76 public function formatDuration( $seconds, array $chosenIntervals = [] ) {
77 if ( empty( $chosenIntervals ) ) {
78 $chosenIntervals = [ 'centuries', 'years', 'days', 'hours', 'minutes', 'seconds' ];
79 }
80
81 $intervals = $this->getDurationIntervals( $seconds, $chosenIntervals );
82
83 $segments = [];
84
85 foreach ( $intervals as $intervalName => $intervalValue ) {
86 // Messages: duration-seconds, duration-minutes, duration-hours, duration-days, duration-weeks,
87 // duration-years, duration-decades, duration-centuries, duration-millennia
88 $message = wfMessage( 'duration-' . $intervalName )->numParams( $intervalValue );
89 $segments[] = $message->inLanguage( $this )->escaped();
90 }
91
92 return implode( '', $segments );
93 }
94}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Simplified Chinese.
segmentByWord( $string)
Eventually this should be a word segmentation; for now just treat each character as a word.
formatDuration( $seconds, array $chosenIntervals=[])
Takes a number of seconds and turns it into a text using values such as hours and minutes.
Internationalisation code.
Definition Language.php:36
static insertSpace( $string, $pattern)
getDurationIntervals( $seconds, array $chosenIntervals=[])
Takes a number of seconds and returns an array with a set of corresponding intervals.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead 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;div ...>$1&lt;/div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))