38 $reg =
"/([\\xc0-\\xff][\\x80-\\xbf]*)/";
44 $s = parent::normalizeForSearch( $s );
50 if ( !$chosenIntervals ) {
51 $chosenIntervals = [
'centuries',
'years',
'days',
'hours',
'minutes',
'seconds' ];
58 foreach ( $intervals as $intervalName => $intervalValue ) {
61 $message =
wfMessage(
'duration-' . $intervalName )->numParams( $intervalValue );
62 $segments[] = $message->inLanguage( $this )->escaped();
65 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.
Base class for language-specific code.
static insertSpace( $string, $pattern)
getDurationIntervals( $seconds, array $chosenIntervals=[])
Takes a number of seconds and returns an array with a set of corresponding intervals.