summaryrefslogtreecommitdiff
path: root/maintenance/language/checkLanguage.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-09-14 13:18:58 +0200
committerPierre Schmitz <pierre@archlinux.de>2007-09-14 13:18:58 +0200
commit8f416baead93a48e5799e44b8bd2e2c4859f4e04 (patch)
treecd47ac55eb80a39e3225e8b4f3161b88ea16c2cf /maintenance/language/checkLanguage.php
parentd7d08bd1a17618c7d77a6b9b2989e9f7293d6ed6 (diff)
auf Version 1.11 aktualisiert; Login-Bug behoben
Diffstat (limited to 'maintenance/language/checkLanguage.php')
-rw-r--r--maintenance/language/checkLanguage.php42
1 files changed, 10 insertions, 32 deletions
diff --git a/maintenance/language/checkLanguage.php b/maintenance/language/checkLanguage.php
index 4ce811c5..42a43c02 100644
--- a/maintenance/language/checkLanguage.php
+++ b/maintenance/language/checkLanguage.php
@@ -11,7 +11,7 @@ require_once( 'checkLanguage.inc' );
# Show help
if ( isset( $options['help'] ) ) {
- echo <<<END
+ echo <<<ENDS
Run this script to check a specific language file, or all of them.
Parameters:
* lang: Language code (default: the installation default language). You can also specify "all" to check all the languages.
@@ -38,37 +38,24 @@ Display levels (default: 2):
* 2: Show only the headers and the message keys, without the message values.
* 3: Show both the headers and the complete messages, with both keys and values.
-END;
+ENDS;
exit();
}
-# Get the language code
-if ( isset( $options['lang'] ) ) {
- $wgCode = $options['lang'];
-} else {
- $wgCode = $wgContLang->getCode();
-}
-
-# Get the display level
-if ( isset( $options['level'] ) ) {
- $wgDisplayLevel = $options['level'];
-} else {
- $wgDisplayLevel = 2;
-}
-
-# Get the links options
+# Get the parameters
+$wgCode = isset( $options['lang'] ) ? $options['lang'] : null;
+$wgDisplayLevel = isset( $options['level'] ) ? $options['level'] : 2;
$wgLinks = isset( $options['links'] );
$wgWikiLanguage = isset( $options['wikilang'] ) ? $options['wikilang'] : 'en';
+$wgCheckEXIF = !isset( $options['noexif'] );
-# Get the checks to do
+# Get the checks
$wgChecks = array( 'untranslated', 'obsolete', 'variables', 'empty', 'whitespace', 'xhtml', 'chars' );
if ( isset( $options['whitelist'] ) ) {
$wgChecks = explode( ',', $options['whitelist'] );
} elseif ( isset( $options['blacklist'] ) ) {
$wgChecks = array_diff( $wgChecks, explode( ',', $options['blacklist'] ) );
}
-
-# Add duplicate and plural options if specified
if ( isset( $options['duplicate'] ) ) {
$wgChecks[] = 'duplicate';
}
@@ -76,16 +63,9 @@ if ( isset( $options['plural'] ) ) {
$wgChecks[] = 'plural';
}
-# Should check for EXIF?
-$wgCheckEXIF = !isset( $options['noexif'] );
-
-# Get language objects
+# Get language object
$wgLanguages = new languages( $wgCheckEXIF );
-# Get the general messages
-$wgGeneralMessages = $wgLanguages->getGeneralMessages();
-$wgRequiredMessagesNumber = count( $wgGeneralMessages['required'] );
-
# Check the language
if ( $wgCode == 'all' ) {
foreach ( $wgLanguages->getLanguages() as $language ) {
@@ -94,14 +74,12 @@ if ( $wgCode == 'all' ) {
}
}
} else {
- # Can't check English
+ # Can't check English or English RTL
if ( $wgCode == 'en' ) {
echo "Current selected language is English, which cannot be checked.\n";
} else if ( $wgCode == 'enRTL' ) {
echo "Current selected language is RTL English, which cannot be checked.\n";
} else {
- checkLanguage( $wgLanguages, $wgCode );
+ checkLanguage( $wgLanguages, $wgCode, $wgDisplayLevel, $wgLinks, $wgWikiLanguage, $wgChecks );
}
}
-
-?>