help(); exit(); } if ( isset($options['lang']) ) { $this->code = $options['lang']; } else { global $wgLanguageCode; $this->code = $wgLanguageCode; } if ( isset($options['level']) ) { $this->level = $options['level']; } $this->doLinks = isset($options['links']); $this->includeExif = !isset($options['noexif']); $this->checkAll = isset($options['all']); if ( isset($options['wikilang']) ) { $this->wikiCode = $options['wikilang']; } if ( isset( $options['whitelist'] ) ) { $this->checks = explode( ',', $options['whitelist'] ); } elseif ( isset( $options['blacklist'] ) ) { $this->checks = array_diff( $this->defaultChecks, explode( ',', $options['blacklist'] ) ); } else { $this->checks = $this->defaultChecks; } if ( isset($options['output']) ) { $this->output = $options['output']; } # Some additional checks not enabled by default if ( isset( $options['duplicate'] ) ) { $this->checks[] = 'duplicate'; } $this->L = new languages( $this->includeExif ); } protected function getChecks() { $checks = array(); $checks['untranslated'] = 'getUntranslatedMessages'; $checks['duplicate'] = 'getDuplicateMessages'; $checks['obsolete'] = 'getObsoleteMessages'; $checks['variables'] = 'getMessagesWithoutVariables'; $checks['plural'] = 'getMessagesWithoutPlural'; $checks['empty'] = 'getEmptyMessages'; $checks['whitespace'] = 'getMessagesWithWhitespace'; $checks['xhtml'] = 'getNonXHTMLMessages'; $checks['chars'] = 'getMessagesWithWrongChars'; $checks['links'] = 'getMessagesWithDubiousLinks'; $checks['unbalanced'] = 'getMessagesWithUnbalanced'; return $checks; } protected function getDescriptions() { $descriptions = array(); $descriptions['untranslated'] = '$1 message(s) of $2 are not translated to $3, but exist in en:'; $descriptions['duplicate'] = '$1 message(s) of $2 are translated the same in en and $3:'; $descriptions['obsolete'] = '$1 message(s) of $2 do not exist in en or are in the ignore list, but are in $3'; $descriptions['variables'] = '$1 message(s) of $2 in $3 don\'t use some variables that en uses:'; $descriptions['plural'] = '$1 message(s) of $2 in $3 don\'t use {{plural}} while en uses:'; $descriptions['empty'] = '$1 message(s) of $2 in $3 are empty or -:'; $descriptions['whitespace'] = '$1 message(s) of $2 in $3 have trailing whitespace:'; $descriptions['xhtml'] = '$1 message(s) of $2 in $3 contain illegal XHTML:'; $descriptions['chars'] = '$1 message(s) of $2 in $3 include hidden chars which should not be used in the messages:'; $descriptions['links'] = '$1 message(s) of $2 in $3 have problematic link(s):'; $descriptions['unbalanced'] = '$1 message(s) of $2 in $3 have unbalanced {[]}:'; return $descriptions; } protected function help() { return <<