From c375e1aa7233125561dad45d0ee207430b773838 Mon Sep 17 00:00:00 2001 From: Matthias Jordan Date: Fri, 1 Aug 2003 12:19:51 +0000 Subject: [PATCH] The new script finds missing translations in more array than just wgAllMessages. --- maintenance/checktrans-enhanced.php | 96 +++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 maintenance/checktrans-enhanced.php diff --git a/maintenance/checktrans-enhanced.php b/maintenance/checktrans-enhanced.php new file mode 100644 index 0000000000..fa06345b37 --- /dev/null +++ b/maintenance/checktrans-enhanced.php @@ -0,0 +1,96 @@ + $msg ) { + ++$total; + + if ( ! array_key_exists( $code, $$msgarray ) ) { + if (!$arraynameprinted) { + print("\nIn array '$msgarray':\n"); + $arraynameprinted = 1; + } + + print "{$code}\n"; + ++$count; + } + } +} + + + + + + +if ( ! is_readable( "../LocalSettings.php" ) ) { + print "A copy of your installation's LocalSettings.php\n" . + "must exist in the source directory.\n"; + exit(); +} + +$DP = "../includes"; +include_once( "../LocalSettings.php" ); + +if ( "en" == $wgLanguageCode ) { + print "Current selected language is English. Cannot check translations.\n"; + exit(); +} +$include = "Language" . ucfirst( $wgLanguageCode ) . ".php"; +if ( ! is_readable( "{$IP}/{$include}" ) ) { + print "Translation file \"{$include}\" not found in installation directory.\n" . + "You must have the software installed to run this script.\n"; + exit(); +} + +umask( 000 ); +set_time_limit( 0 ); + +include_once( "{$IP}/Setup.php" ); +$wgTitle = Title::newFromText( "Translation checking script" ); +$wgCommandLineMode = true; + +$count = $total = 0; + + + + + + + +check("wgLanguageNames"); +check("wgNamespaceNames"); +check("wgDefaultUserOptions"); +check("wgQuickbarSettings"); +check("wgSkinNames"); +check("wgMathNames"); +check("wgUserToggles"); +check("wgWeekdayNames"); +check("wgMonthNames"); +check("wgMonthAbbreviations"); +check("wgValidSpecialPages"); +check("wgSysopSpecialPages"); +check("wgDeveloperSpecialPages"); +check("wgAllMessages"); + +print "{$count} messages of {$total} not translated.\n"; + -- 2.20.1