100 $cb =
static function ( $parser, $frame, $args ) use ( &$plurals ) {
103 foreach ( $args as $index => $form ) {
105 if ( $index !== 0 ) {
107 $forms[] = $frame->expand( $form, PPFrame::RECOVER_ORIG );
109 $frame->expand( $form );
118 $services = MediaWikiServices::getInstance();
119 $parser = $services->getParserFactory()->create();
121 $parser->firstCallInit();
123 $parser->setFunctionHook(
'plural', $cb, Parser::SFH_NO_HASH | Parser::SFH_OBJECT_ARGS );
127 $options = ParserOptions::newFromUserAndLang(
128 $services->getUserFactory()->newAnonymous(),
129 $services->getLanguageFactory()->getLanguage(
'en' )
132 $parser->preprocess( $translation, $title, $options );