118 $cb =
static function ( $parser, $frame, $args ) use ( &$plurals ) {
121 foreach ( $args as $index => $form ) {
123 if ( $index !== 0 ) {
125 $forms[] = $frame->expand( $form, PPFrame::RECOVER_ORIG );
127 $frame->expand( $form );
136 $parser = $this->parserFactory->create();
137 $parser->setFunctionHook(
'plural', $cb, Parser::SFH_NO_HASH | Parser::SFH_OBJECT_ARGS );
141 $options = ParserOptions::newFromUserAndLang(
142 $this->userFactory->newAnonymous(),
143 $this->languageFactory->getLanguage(
'en' )
146 $parser->preprocess( $translation, $title, $options );