10use MediaWiki\Maintenance\Maintenance;
13if ( getenv(
'MW_INSTALL_PATH' ) !==
false ) {
14 $IP = getenv(
'MW_INSTALL_PATH' );
17 $IP =
"$dir/../../..";
19require_once
"$IP/maintenance/Maintenance.php";
22 public function __construct() {
23 parent::__construct();
24 $this->addDescription(
'Expands a message group specification.' );
27 'List only groups that can be exported',
34 'For example page-*,main',
37 $this->requireExtension(
'Translate' );
40 public function execute() {
41 $spec = $this->getArg( 0 );
42 $patterns = explode(
',', trim( $spec ) );
43 $ids = MessageGroups::expandWildcards( $patterns );
45 if ( $this->getOption(
'exportable' ) ) {
46 foreach ( $ids as $index => $id ) {
48 unset( $ids[ $index ] );
55 echo implode(
"\n", $ids ) .
"\n";
60$maintClass = TranslateExpandGroupSpec::class;
61require_once RUN_MAINTENANCE_IF_MAIN;
This class implements default behavior for file based message groups.