Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/347620 )

Change subject: Use retrieving label lookup form lexical category and language 
labels
......................................................................

Use retrieving label lookup form lexical category and language labels

Warning! This is more a band-aid patch. For a proper solution we need
to "teach" the existing EntityParserOutputDataUpdater how to deal with
Lexemes, or better: make it possible to override the default
EntityParserOutputDataUpdater with one that knows about Lexeme-specific
concepts.

We need to do this anyway the moment we have Statements inside Forms
and Senses. I would tackle the issue then, and call T162698 "done" with
this patch.

Bug: T162698
Change-Id: Iafd868db2fe4e8408f59439b9af2344e60d37bb3
---
M src/View/LexemeViewFactory.php
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/20/347620/1

diff --git a/src/View/LexemeViewFactory.php b/src/View/LexemeViewFactory.php
index 5e012d8..9916586 100644
--- a/src/View/LexemeViewFactory.php
+++ b/src/View/LexemeViewFactory.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Lexeme\View;
 
+use Language;
 use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup;
 use Wikibase\LanguageFallbackChain;
 use Wikibase\Lexeme\View\Template\LexemeTemplateFactory;
@@ -89,6 +90,14 @@
                        new LanguageNameLookup( $this->languageCode )
                );
 
+               // TODO: $this->labelDescriptionLookup is an EntityInfo based 
lookup that only knows
+               // entities processed via EntityParserOutputDataUpdater first, 
which processes statements
+               // and sitelinks only and does not know about Lexeme-specific 
concepts like lexical category
+               // and language.
+               $retrievingLabelDescriptionLookup = $wikibaseRepo
+                       ->getLanguageFallbackLabelDescriptionLookupFactory()
+                       ->newLabelDescriptionLookup( Language::factory( 
$this->languageCode ) );
+
                return new LexemeView(
                        TemplateFactory::getDefaultInstance(),
                        $this->entityTermsView,
@@ -98,7 +107,7 @@
                        $sensesView,
                        $statementSectionsView,
                        $htmlTermRenderer,
-                       $this->labelDescriptionLookup
+                       $retrievingLabelDescriptionLookup
                );
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafd868db2fe4e8408f59439b9af2344e60d37bb3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

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

Reply via email to