idPrefix . $sanitizedName; } if ( isset( $g['file'] ) ) { $file = $g['file']; } else { // Canonical names for Intuition text-domains are lowercase // eg. "MyTool" -> "mytool/en.json" $file = "$sanitizedName/%CODE%.json"; } if ( isset( $g['descmsg'] ) ) { $descmsg = $g['descmsg']; } else { $descmsg = "$id-desc"; } if ( isset( $g['url'] ) ) { $url = $g['url']; } else { $url = false; } $newgroup = [ 'name' => 'Intuition - ' . $name, 'file' => $file, 'descmsg' => $descmsg, 'url' => $url, ]; // Prefix is required, if not customized use the sanitized name if ( !isset( $g['prefix'] ) ) { $g['prefix'] = "$sanitizedName-"; } // All messages are prefixed with their groupname $g['mangle'] = [ '*' ]; // Prevent E_NOTICE undefined index. // PremadeMediawikiExtensionGroups::factory should probably check this better instead if ( !isset( $g['ignored'] ) ) { $g['ignored'] = []; } if ( !isset( $g['optional'] ) ) { $g['optional'] = []; } $g['format'] = 'json'; $copyvars = [ 'aliasfile', 'desc', 'format', 'ignored', 'magicfile', 'mangle', 'optional', 'prefix', 'var', ]; foreach ( $copyvars as $var ) { if ( isset( $g[$var] ) ) { $newgroup[$var] = $g[$var]; } } $fixedGroups[$id] = $newgroup; } return $fixedGroups; } }