48 $reg =
"/([\\xc0-\\xff][\\x80-\\xbf]*)/";
59 $s = parent::normalizeForSearch(
$s );
77 if ( empty( $chosenIntervals ) ) {
78 $chosenIntervals = [
'centuries',
'years',
'days',
'hours',
'minutes',
'seconds' ];
85 foreach ( $intervals as $intervalName => $intervalValue ) {
88 $message =
wfMessage(
'duration-' . $intervalName )->numParams( $intervalValue );
89 $segments[] = $message->inLanguage( $this )->escaped();
92 return implode(
'', $segments );
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
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 See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
static insertSpace( $string, $pattern)
getDurationIntervals( $seconds, array $chosenIntervals=[])
Takes a number of seconds and returns an array with a set of corresponding intervals.