diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
commit | 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch) | |
tree | 577a29fb579188d16003a209ce2a2e9c5b0aa2bd /languages/classes/LanguageZh_hans.php | |
parent | cacc939b34e315b85e2d72997811eb6677996cc1 (diff) |
Update to MediaWiki 1.21.1
Diffstat (limited to 'languages/classes/LanguageZh_hans.php')
-rw-r--r-- | languages/classes/LanguageZh_hans.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/languages/classes/LanguageZh_hans.php b/languages/classes/LanguageZh_hans.php index d95c42ea..04b2e16a 100644 --- a/languages/classes/LanguageZh_hans.php +++ b/languages/classes/LanguageZh_hans.php @@ -65,4 +65,31 @@ class LanguageZh_hans extends Language { wfProfileOut( __METHOD__ ); return $s; } + + /** + * Takes a number of seconds and turns it into a text using values such as hours and minutes. + * + * @since 1.21 + * + * @param integer $seconds The amount of seconds. + * @param array $chosenIntervals The intervals to enable. + * + * @return string + */ + public function formatDuration( $seconds, array $chosenIntervals = array() ) { + if ( empty( $chosenIntervals ) ) { + $chosenIntervals = array( 'centuries', 'years', 'days', 'hours', 'minutes', 'seconds' ); + } + + $intervals = $this->getDurationIntervals( $seconds, $chosenIntervals ); + + $segments = array(); + + foreach ( $intervals as $intervalName => $intervalValue ) { + $message = wfMessage( 'duration-' . $intervalName )->numParams( $intervalValue ); + $segments[] = $message->inLanguage( $this )->escaped(); + } + + return implode( '', $segments ); + } } |