WikibaseLexeme
MediaWiki WikibaseLexeme extension
|
Variables | |
return [ 'PT:wikibase-lexeme'=>['expert-module'=> 'wikibase.experts.Lexeme', 'validator-factory-callback'=> static function() { $factory=WikibaseRepo::getDefaultValidatorBuilders();return $factory->getEntityValidators(Lexeme::ENTITY_TYPE);}, 'formatter-factory-callback'=> static function( $format, FormatterOptions $options) { $snakFormat=new SnakFormat();if( $snakFormat->getBaseFormat( $format)===SnakFormatter::FORMAT_HTML) { $userLanguage=WikibaseRepo::getUserLanguage();$labelDescriptionLookup=WikibaseRepo::getFallbackLabelDescriptionLookupFactory() ->newLabelDescriptionLookup( $userLanguage);return new EntityIdValueFormatter(new LexemeIdHtmlFormatter(WikibaseRepo::getEntityLookup(), $labelDescriptionLookup, WikibaseRepo::getEntityTitleLookup(), new MediaWikiLocalizedTextProvider( $userLanguage), new NonExistingEntityIdHtmlFormatter('wikibaselexeme-deletedentity-')));} return WikibaseRepo::getDefaultValueFormatterBuilders() ->newEntityIdFormatter( $format, $options);}, 'value-type'=> 'wikibase-entityid',], 'PT:wikibase-form'=>['expert-module'=> 'wikibase.experts.Form', 'validator-factory-callback'=> static function() { $factory=WikibaseRepo::getDefaultValidatorBuilders();return $factory->getEntityValidators(Form::ENTITY_TYPE);}, 'formatter-factory-callback'=> static function( $format, FormatterOptions $options) { $mwServices=MediaWikiServices::getInstance();$userLanguage=WikibaseRepo::getUserLanguage( $mwServices);$revisionLookup=WikibaseRepo::getEntityRevisionLookup( $mwServices);$textProvider=new MediaWikiLocalizedTextProvider( $userLanguage);$snakFormat=new SnakFormat();if( $snakFormat->getBaseFormat( $format)===SnakFormatter::FORMAT_HTML) { $titleLookup=WikibaseRepo::getEntityTitleLookup( $mwServices);$baseFormatter=new FormIdHtmlFormatter($revisionLookup, WikibaseRepo::getFallbackLabelDescriptionLookupFactory( $mwServices) ->newLabelDescriptionLookup( $userLanguage), $titleLookup, $textProvider, new RedirectedLexemeSubEntityIdHtmlFormatter( $titleLookup), $mwServices->getLanguageFactory());} else { $baseFormatter=new FormIdTextFormatter($revisionLookup, $textProvider);} return new EntityIdValueFormatter($baseFormatter);}, 'value-type'=> 'wikibase-entityid',], 'PT:wikibase-sense'=>['expert-module'=> 'wikibase.experts.Sense', 'validator-factory-callback'=> static function() { $factory=WikibaseRepo::getDefaultValidatorBuilders();return $factory->getEntityValidators(Sense::ENTITY_TYPE);}, 'formatter-factory-callback'=> static function( $format, FormatterOptions $options) { $mwServices=MediaWikiServices::getInstance();$revisionLookup=WikibaseRepo::getEntityRevisionLookup( $mwServices);$language=WikibaseRepo::getUserLanguage( $mwServices);$localizedTextProvider=new MediaWikiLocalizedTextProvider( $language);$entityIdLabelFormatter=WikibaseRepo::getEntityIdLabelFormatterFactory( $mwServices) ->getEntityIdFormatter( $language);$languageFallbackChainFactory=WikibaseRepo::getLanguageFallbackChainFactory();$fallbackChain=$languageFallbackChainFactory->newFromLanguage( $language);$snakFormat=new SnakFormat();if( $snakFormat->getBaseFormat( $format)===SnakFormatter::FORMAT_HTML) { $titleLookup=WikibaseRepo::getEntityTitleLookup( $mwServices);$languageNameLookup=WikibaseRepo::getLanguageNameLookupFactory( $mwServices) ->getForLanguage( $language);return new EntityIdValueFormatter(new SenseIdHtmlFormatter($titleLookup, $revisionLookup, $localizedTextProvider, $fallbackChain, new LanguageFallbackIndicator( $languageNameLookup), $mwServices->getLanguageFactory(), $entityIdLabelFormatter));} return new EntityIdValueFormatter(new SenseIdTextFormatter($revisionLookup, $localizedTextProvider, $entityIdLabelFormatter));}, 'value-type'=> 'wikibase-entityid',],] | |
return['PT:wikibase-lexeme'=>[ 'expert-module'=> 'wikibase.experts.Lexeme', 'validator-factory-callback'=> static function() { $factory=WikibaseRepo::getDefaultValidatorBuilders(); return $factory->getEntityValidators(Lexeme::ENTITY_TYPE); }, 'formatter-factory-callback'=> static function($format, FormatterOptions $options) { $snakFormat=new SnakFormat(); if($snakFormat->getBaseFormat($format)===SnakFormatter::FORMAT_HTML) { $userLanguage=WikibaseRepo::getUserLanguage(); $labelDescriptionLookup=WikibaseRepo::getFallbackLabelDescriptionLookupFactory() ->newLabelDescriptionLookup($userLanguage); return new EntityIdValueFormatter( new LexemeIdHtmlFormatter( WikibaseRepo::getEntityLookup(), $labelDescriptionLookup, WikibaseRepo::getEntityTitleLookup(), new MediaWikiLocalizedTextProvider($userLanguage), new NonExistingEntityIdHtmlFormatter( 'wikibaselexeme-deletedentity-'))); } return WikibaseRepo::getDefaultValueFormatterBuilders() ->newEntityIdFormatter($format, $options); }, 'value-type'=> 'wikibase-entityid',], 'PT:wikibase-form'=>[ 'expert-module'=> 'wikibase.experts.Form', 'validator-factory-callback'=> static function() { $factory=WikibaseRepo::getDefaultValidatorBuilders(); return $factory->getEntityValidators(Form::ENTITY_TYPE); }, 'formatter-factory-callback'=> static function($format, FormatterOptions $options) { $mwServices=MediaWikiServices::getInstance(); $userLanguage=WikibaseRepo::getUserLanguage($mwServices); $revisionLookup=WikibaseRepo::getEntityRevisionLookup($mwServices); $textProvider=new MediaWikiLocalizedTextProvider($userLanguage); $snakFormat=new SnakFormat(); if($snakFormat->getBaseFormat($format)===SnakFormatter::FORMAT_HTML) { $titleLookup=WikibaseRepo::getEntityTitleLookup($mwServices); $baseFormatter=new FormIdHtmlFormatter( $revisionLookup, WikibaseRepo::getFallbackLabelDescriptionLookupFactory($mwServices) ->newLabelDescriptionLookup($userLanguage), $titleLookup, $textProvider, new RedirectedLexemeSubEntityIdHtmlFormatter($titleLookup), $mwServices->getLanguageFactory()); } else { $baseFormatter=new FormIdTextFormatter( $revisionLookup, $textProvider); } return new EntityIdValueFormatter( $baseFormatter); }, 'value-type'=> 'wikibase-entityid',], 'PT:wikibase-sense'=>[ 'expert-module'=> 'wikibase.experts.Sense', 'validator-factory-callback'=> static function() { $factory=WikibaseRepo::getDefaultValidatorBuilders(); return $factory->getEntityValidators(Sense::ENTITY_TYPE); }, 'formatter-factory-callback'=> static function($format, FormatterOptions $options) { $mwServices=MediaWikiServices::getInstance(); $revisionLookup=WikibaseRepo::getEntityRevisionLookup($mwServices); $language=WikibaseRepo::getUserLanguage($mwServices); $localizedTextProvider=new MediaWikiLocalizedTextProvider($language); $entityIdLabelFormatter=WikibaseRepo::getEntityIdLabelFormatterFactory($mwServices) ->getEntityIdFormatter($language); $languageFallbackChainFactory=WikibaseRepo::getLanguageFallbackChainFactory(); $fallbackChain=$languageFallbackChainFactory->newFromLanguage($language); $snakFormat=new SnakFormat(); if($snakFormat->getBaseFormat($format)===SnakFormatter::FORMAT_HTML) { $titleLookup=WikibaseRepo::getEntityTitleLookup($mwServices); $languageNameLookup=WikibaseRepo::getLanguageNameLookupFactory($mwServices) ->getForLanguage($language); return new EntityIdValueFormatter( new SenseIdHtmlFormatter( $titleLookup, $revisionLookup, $localizedTextProvider, $fallbackChain, new LanguageFallbackIndicator($languageNameLookup), $mwServices->getLanguageFactory(), $entityIdLabelFormatter)); } return new EntityIdValueFormatter( new SenseIdTextFormatter( $revisionLookup, $localizedTextProvider, $entityIdLabelFormatter)); }, 'value-type'=> 'wikibase-entityid',],] |