User "Aaron Schulz" posted a comment on MediaWiki.r97962.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97962#c23145
Commit summary:

Make Language::formatTimePeriod() more flexible so it can produce stuff like '3 
hours ago'.

* Add a $noAbbrevs parameter that causes the 'seconds', 'minutes', etc. 
messages to be used instead of the 'seconds-abbrev', 'minutes-abbrev', etc. 
messages
* Add the 'seconds', 'minutes', 'hours' and 'days' messages
* Change the -abbrev messages to take a parameter rather than having the number 
prepended to them. This is for compatibility with 'seconds' et al, which need 
the parameter for {{PLURAL:}}. It also generally makes more sense. This does 
BREAK the messages in non-English languages that override them; Niklas told me 
to leave this alone and ping the TranslateWiki folks
* Introduce an 'ago' message for '$1 ago'. Not currently used in core, but I 
want to use it in an extension and it seemed stupid not to have such a thing in 
core.
* Refactor the function to use message objects and pass the number as a 
parameter
* Add tests! They exposed a subtle bug in my first iteration; all hail tests!

Comment:

Maybe you should have just redid $format into $options as an associative array. 
If a string came in, for b/c it could set $options['avoid'].

Otherwise OK.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to