As of T37489, Translate supports arbitrary source languages for translatable pages, which can either be set via Special:PageContentLanguage or programmatically via a PageContentLanguage hook. This does not extend to aggregate groups yet, which are still hardcoded to English. As a result, trying to translate the whole group at once into English via Special:Translate doesn't work, with ApiQueryMessageCollection returning a apiwarn-translate-language-disabled-source message.
For now, the simplest way to achieve this would be to add a new optional metadata key, consistent with MessageGroupBase::getSourceLanguage(), to at least allow manual configuration by inserting rows into the translate_metadata table. On top of 7c2802b:
diff --- a/messagegroups/loaders/AggregateMessageGroupLoader.php +++ b/messagegroups/loaders/AggregateMessageGroupLoader.php @@ -104,20 +104,23 @@ class AggregateMessageGroupLoader extends MessageGroupLoader foreach ( $groupIds as $id ) { $conf = []; $conf['BASIC'] = [ 'id' => $id, 'label' => TranslateMetadata::get( $id, 'name' ), 'description' => TranslateMetadata::get( $id, 'description' ), 'meta' => 1, 'class' => AggregateMessageGroup::class, 'namespace' => NS_TRANSLATIONS, ]; + if ( $sourcelanguage = TranslateMetadata::get( $id, 'sourcelanguage' ) ) { + $conf['BASIC']['sourcelanguage'] = $sourcelanguage; + } $conf['GROUPS'] = TranslateMetadata::getSubgroups( $id ); $groups[$id] = $conf; } return $groups; }
It's not optimal because an aggregate group may still contain pages in any source language, which you may or may not want to prevent. But it'd be good enough for a first step.