Would be nice if it was possible to add a test for {{#time:d F Y|1988-02-28|user}} where user language is "nl", because that does not work. Ref bug 28655 comment 10 and comment 17.
This would make something like {{#time:H:i:s| 9:30 January 1, 2012 MST}} convert the time from 9:30 mountatin standard time to whatever it is in UTC.
I made one minor change from the patch on bugzilla in changing an @ to a wfSuppressWarnings. (The @ was already in the code, it wasn't introduced by the patch).
* Disable {{#convert}} function by default. This means that this change will not be live by default, so the fixme doesn't block WMF deployment, although it probably should still block the tarball.
* Documentation and type hinting
* Fix minor errors noted by Tim in CR.
the position can be changed depending on the plural, as requested by Amir in
http://lists.wikimedia.org/pipermail/mediawiki-i18n/2011-August/000338.html
Placing the text after the unit could get funny in cases where there is
more text than just the number and the unit, but it's not a problem for the
parserfunction to fix.
The transformations for ParserFunctions.i18n.php were
On pfunc-convert-unit messages: s/$2/$3/, s/$1/$2/
s/'pfunc-convert-unit-.*' *=> '/\0$1/
Failure:
ConvertTests::testParserTest with data set #11 ('#language', '*{{#convert: 10 m | km | #language=en-gb }}
*{{#convert: 10m | km | #language = en-gb }}
*{{#convert: 10 km | m |#language=en-gb}}
*{{#convert: 10 Pa | mmHg | #language = en-gb }}', '<ul><li>0.01 kilometres
</li><li>0.01kilometres
</li><li>10,000 metres
</li><li>0.1 milimetres of mercury
</li></ul>
', '', '')
#language
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
<ul><li>0.01 kilometres
</li><li>0.01kilometres
</li><li>10,000 metres
-</li><li>0.1 milimetres of mercury
+</li><li>0.1 millimetres of mercury
</li></ul>
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/parser/NewParserTest.php:539
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:31
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60
ConvertTests::testParserTest with data set #12 ('Case sensitivity', '*{{#convert: 10 mm | m }}
*{{#convert: 10 Mm | m }}
*{{#convert: 10 km | Mm }}
*{{#convert: 10 Pa | mmHg }}
*{{#convert: 10 pa | mmHg }}', '<ul><li>0.01 meters
</li><li>10,000,000 meters
</li><li>0.01 megameters
</li><li>0.1 milimeters of mercury
</li><li><strong class="error">Error: Unknown unit "pa".</strong>
</li></ul>
', '', '')
Case sensitivity
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
<ul><li>0.01 meters
</li><li>10,000,000 meters
</li><li>0.01 megameters
-</li><li>0.1 milimeters of mercury
+</li><li>0.1 millimeters of mercury
</li><li><strong class="error">Error: Unknown unit "pa".</strong>
</li></ul>
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/parser/NewParserTest.php:539
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:31
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60