jenkins-bot has submitted this change and it was merged.

Change subject: Use correct options for GlobeCoordinateFormatter
......................................................................


Use correct options for GlobeCoordinateFormatter

Change-Id: I8152220c1ff72170d1e32fbcc728dbcf9fce60ea
---
M lib/includes/formatters/WikibaseValueFormatterBuilders.php
1 file changed, 19 insertions(+), 1 deletion(-)

Approvals:
  Aude: Looks good to me, approved
  WikidataJenkins: Verified
  jenkins-bot: Verified



diff --git a/lib/includes/formatters/WikibaseValueFormatterBuilders.php 
b/lib/includes/formatters/WikibaseValueFormatterBuilders.php
index e0dca5a..a2b0ac2 100644
--- a/lib/includes/formatters/WikibaseValueFormatterBuilders.php
+++ b/lib/includes/formatters/WikibaseValueFormatterBuilders.php
@@ -7,6 +7,8 @@
 use RuntimeException;
 use ValueFormatters\DecimalFormatter;
 use ValueFormatters\FormatterOptions;
+use ValueFormatters\GeoCoordinateFormatter;
+use ValueFormatters\GlobeCoordinateFormatter;
 use ValueFormatters\QuantityFormatter;
 use ValueFormatters\ValueFormatter;
 use Wikibase\EntityLookup;
@@ -60,7 +62,7 @@
                // formatters to use for plain text output
                SnakFormatter::FORMAT_PLAIN => array(
                        'VT:string' => 'ValueFormatters\StringFormatter',
-                       'VT:globecoordinate' => 
'ValueFormatters\GlobeCoordinateFormatter',
+                       'VT:globecoordinate' => array( 
'Wikibase\Lib\WikibaseValueFormatterBuilders', 'newGlobeCoordinateFormatter' ),
                        'VT:quantity' =>  array( 
'Wikibase\Lib\WikibaseValueFormatterBuilders', 'newQuantityFormatter' ),
                        'VT:time' => 'Wikibase\Lib\MwTimeIsoFormatter',
                        'VT:wikibase-entityid' => array( 
'Wikibase\Lib\WikibaseValueFormatterBuilders', 'newEntityIdFormatter' ),
@@ -544,6 +546,22 @@
        }
 
        /**
+        * Builder callback for use in 
WikibaseValueFormatterBuilders::$valueFormatterSpecs.
+        * Used to compose the GlobeCoordinateFormatter.
+        *
+        * @param FormatterOptions $options
+        * @param WikibaseValueFormatterBuilders $builders
+        *
+        * @return GlobeCoordinateFormatter
+        */
+       protected static function newGlobeCoordinateFormatter( FormatterOptions 
$options, WikibaseValueFormatterBuilders $builders ) {
+               $options->setOption( GeoCoordinateFormatter::OPT_FORMAT, 
GeoCoordinateFormatter::TYPE_DMS );
+               $options->setOption( GeoCoordinateFormatter::OPT_SPACING_LEVEL, 
array() );
+               $options->setOption( GeoCoordinateFormatter::OPT_DIRECTIONAL, 
true );
+               return new GlobeCoordinateFormatter( $options );
+       }
+
+       /**
         * Wrap each entry in a list of formatters in an EscapingValueFormatter.
         * This is useful to apply escaping to the output of a set of 
formatters,
         * allowing them to be used for a different format.

-- 
To view, visit https://gerrit.wikimedia.org/r/120314
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8152220c1ff72170d1e32fbcc728dbcf9fce60ea
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Adrian Lang <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: WikidataJenkins <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to