47 $groups = MessageGroups::getAllGroups();
51 foreach ( $groups as $g ) {
52 $states = $g->getMessageGroupStates()->getStates();
53 foreach ( array_keys( $states ) as $state ) {
54 $keys[
"Translate-workflow-state-$state"] = $state;
62 $defs = Utilities::getContents( array_keys( $keys ), $this->
getNamespace() );
63 $wikiPageFactory = MediaWikiServices::getInstance()->getWikiPageFactory();
64 foreach ( $keys as $key => $state ) {
65 if ( !isset( $defs[$key] ) ) {
67 $title = Title::makeTitleSafe( $this->
getNamespace(), $key );
68 $page = $wikiPageFactory->newFromTitle( $title );
69 $content = ContentHandler::makeContent( $state, $title );
70 $fuzzyBotUser = FuzzyBot::getUser();
72 $updater = $page->newPageUpdater( $fuzzyBotUser )
73 ->setContent( SlotRecord::MAIN, $content );
74 if ( $fuzzyBotUser->authorizeWrite(
'autopatrol', $title ) ) {
75 $updater->setRcPatrolStatus( RecentChange::PRC_AUTOPATROLLED );
78 $summary = wfMessage(
'translate-workflow-autocreated-summary', $state )->inContentLanguage()->text();
79 $updater->saveRevision(
80 CommentStoreComment::newUnsavedComment( $summary ),
86 [ $content, ] = $defs[$key];
87 $keys[$key] = $content;