31 private const WORD_SEGMENTATION_REGEX =
'/([\xc0-\xff][\x80-\xbf]*)/';
48 $s = parent::normalizeForSearch( $s );
54 if ( !$chosenIntervals ) {
55 $chosenIntervals = [
'centuries',
'years',
'days',
'hours',
'minutes',
'seconds' ];
62 foreach ( $intervals as $intervalName => $intervalValue ) {
65 $message =
wfMessage(
'duration-' . $intervalName )->numParams( $intervalValue );
66 $segments[] = $message->inLanguage( $this )->escaped();
69 return implode(
'', $segments );
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
hasWordBreaks()
Most writing systems use whitespace to break up words.
formatDuration( $seconds, array $chosenIntervals=[])
Takes a number of seconds and turns it into a text using values such as hours and minutes.
normalizeForSearch( $s)
Some languages have special punctuation need to be normalized.