Lucas_Werkmeister_WMDE added a comment.
This patch (in Wikibase, not WikibaseLexeme!) makes the labels show up – it’s
certainly not an ideal implementation yet, and it remains to be investigated
which other places are affected by it (and whether we want those other places
to resolve redirects as well), but it’s a good starting point, I think:
diff --git a/repo/WikibaseRepo.entitytypes.php
b/repo/WikibaseRepo.entitytypes.php
index 63ab398b8e..7f5d11ca23 100644
--- a/repo/WikibaseRepo.entitytypes.php
+++ b/repo/WikibaseRepo.entitytypes.php
@@ -18,6 +18,7 @@
*/
use MediaWiki\MediaWikiServices;
+use ValueFormatters\FormatterOptions;
use Wikibase\DataAccess\DatabaseEntitySource;
use Wikibase\DataModel\Entity\EntityDocument;
use Wikibase\DataModel\Entity\Item;
@@ -27,6 +28,7 @@
use Wikibase\Lib\DataTypeDefinitions;
use Wikibase\Lib\EntityTypeDefinitions as Def;
use Wikibase\Lib\EntityTypeDefinitions;
+use Wikibase\Lib\Formatters\FormatterLabelDescriptionLookupFactory;
use Wikibase\Lib\Formatters\LabelsProviderEntityIdHtmlLinkFormatter;
use Wikibase\Lib\Interactors\MatchingTermsLookupSearchInteractor;
use Wikibase\Lib\SimpleCacheWithBagOStuff;
@@ -245,8 +247,17 @@
);
},
Def::ENTITY_ID_HTML_LINK_FORMATTER_CALLBACK => function(
Language $language ) {
- $languageLabelLookupFactory =
WikibaseRepo::getLanguageFallbackLabelDescriptionLookupFactory();
- $languageLabelLookup =
$languageLabelLookupFactory->newLabelDescriptionLookup( $language );
+ $formatterLabelDescriptionLookupFactory = new
FormatterLabelDescriptionLookupFactory(
+ WikibaseRepo::getTermLookup(),
+ WikibaseRepo::getTermFallbackCache(),
+ new RedirectResolvingLatestRevisionLookup(
WikibaseRepo::getEntityRevisionLookup() )
+ );
+ $languageFallbackChainFactory =
WikibaseRepo::getLanguageFallbackChainFactory();
+ $languageFallbackChain =
$languageFallbackChainFactory->newFromLanguage( $language );
+ $options = new FormatterOptions( [
+
FormatterLabelDescriptionLookupFactory::OPT_LANGUAGE_FALLBACK_CHAIN =>
$languageFallbackChain,
+ ] );
+ $languageLabelLookup =
$formatterLabelDescriptionLookupFactory->getLabelDescriptionLookup( $options );
return new LabelsProviderEntityIdHtmlLinkFormatter(
$languageLabelLookup,
WikibaseRepo::getLanguageNameLookup(),
TASK DETAIL
https://phabricator.wikimedia.org/T305032
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, Lydia_Pintscher, Astuthiodit_1, karapayneWMDE,
Invadibot, maantietaja, ItamarWMDE, Akuckartz, Nandana, Lahi, Gq86,
GoranSMilovanovic, Mahir256, QZanden, LawExplorer, _jensen, rosalieper,
Bodhisattwa, Scott_WUaS, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]