maintenance/language/diffLanguage.php File Reference

Usage: php DiffLanguage.php [lang [file]]. More...

Go to the source code of this file.

Functions

 usage ()
 ucfirstlcrest ($string)
 Return a given string with first letter upper case, the rest lowercase.
 getMediawikiMessages ($languageCode= 'En')
 Return a $wgAllmessages array shipped in MediaWiki.
 getExternalMessages ($filename, $languageCode)
 Return a $wgAllmessages array in a given file.

Variables

if(isset($options['help'])) $wgLanguageCode = ucfirstlcrest($wgLanguageCode)
 This script run from the commandline.
 $referenceMessages = $wgAllMessagesEn
 Language messages we will use as reference.
 $referenceLanguage = 'En'
 $referenceFilename = 'Language'.$referenceLanguage.'.php'
 $testMessages = array()
 Language messages we will test.
 $testLanguage = ''
 $externalRef = false
 whereas we use an external language file
 $i = 0
 $msg = "MW Language{$testLanguage}.php against "
 foreach ($referenceMessages as $index=> $ref)


Detailed Description

Usage: php DiffLanguage.php [lang [file]].

lang: Enter the language code following "Language" of the LanguageXX.php you want to check. If using linux you might need to follow case aka Zh and not zh.

file: A php language file you want to include to compare mediawiki Language{Lang}.php against (for example Special:Allmessages PHP output).

The goal is to get a list of messages not yet localised in a languageXX.php file using the language.php file as reference.

The script then print a list of wgAllMessagesXX keys that aren't localised, a percentage of messages correctly localised and the number of messages to be translated.

Definition in file diffLanguage.php.


Function Documentation

getExternalMessages ( filename,
languageCode 
)

Return a $wgAllmessages array in a given file.

Language of the array need to be given cause we can not detect which language it provides

Parameters:
string $filename Filename of the file containing a message array
string $languageCode Language of the external array
Returns:
array A $wgAllMessages array from an external file.

Definition at line 100 of file diffLanguage.php.

References $filename, and print.

getMediawikiMessages ( languageCode = 'En'  ) 

Return a $wgAllmessages array shipped in MediaWiki.

Parameters:
string $languageCode Formated language code
Returns:
array The MediaWiki default $wgAllMessages array requested

Definition at line 75 of file diffLanguage.php.

References $IP, print, and wfDie().

ucfirstlcrest ( string  ) 

Return a given string with first letter upper case, the rest lowercase.

Definition at line 66 of file diffLanguage.php.

usage (  ) 

Todo:
more informations !!

Definition at line 61 of file diffLanguage.php.

Referenced by userOptions::showUsageAndExit().


Variable Documentation

$externalRef = false

whereas we use an external language file

Definition at line 57 of file diffLanguage.php.

$i = 0

Definition at line 134 of file diffLanguage.php.

$msg = "MW Language{$testLanguage}.php against "

Definition at line 136 of file diffLanguage.php.

Referenced by Parser_DiffTest::__call(), DeletedContribsPager::__construct(), ContribsPager::__construct(), MediaTransformError::__construct(), DBConnectionError::__construct(), MathRenderer::_error(), UsercreateTemplate::addInputItem(), OutputPage::blockedPage(), ProtectionForm::buildForm(), ExtensionInstaller::confirm(), RecompressTracked::critical(), RecompressTracked::debug(), SpecialResetpass::error(), OutputPage::errorpage(), TableDiffFormatter::escapeWhiteSpace(), SpecialListGroupRights::execute(), SpecialNewpages::filterLinks(), LogPage::formatBlockFlag(), SpecialVersion::formatCredits(), Block::formatExpiry(), UserRestrictionsPager::formatRestriction(), IPUnblockForm::formatRow(), Language::formatSize(), getCategoryLinks(), getCopyright(), UploadForm::getDupeWarning(), WhatLinksHerePage::getFilterPanel(), SpecialStatistics::getGroupStats(), RevisionDeleter::getLogMessage(), Language::getMessageFromDB(), ProtectionForm::getOptionLabel(), getUndeleteLink(), Status::hasMessage(), QuickTemplate::haveMsg(), RecompressTracked::info(), Article::info(), ChangesList::insertMove(), WhatLinksHerePage::listItem(), RecompressTracked::logToFile(), LoginForm::mainLoginForm(), UploadForm::mainUploadForm(), ApiQuery::makeHelpMsg(), ApiMain::makeHelpMsg(), ApiBase::makeHelpMsg(), ApiQuery::makeHelpMsgHelper(), ApiBase::makeHelpMsgParameters(), LoginForm::makeLanguageSelector(), SpecialPage::outputHeader(), PageHistory::preCacheMessages(), LogEventsList::preCacheMessages(), ChangesList::preCacheMessages(), ImagePage::printSharedImageText(), ExtensionInstaller::prompt(), SquidUpdate::purge(), EnhancedChangesList::recentChangesLine(), runJobsLog(), PreferencesForm::savePreferences(), ApiQueryBase::setContinueEnumParameter(), EditPage::setHeaders(), ApiBase::setWarning(), OutputPage::showErrorPage(), IPBlockForm::showForm(), ProtectedTitlesForm::showList(), ProtectedPagesForm::showList(), IPUnblockForm::showList(), ChangeTags::tagDescription(), wfBacktrace(), wfDebugDieBacktrace(), wfDeprecated(), wfDie(), and wfThumbError().

$referenceFilename = 'Language'.$referenceLanguage.'.php'

Definition at line 52 of file diffLanguage.php.

$referenceLanguage = 'En'

Definition at line 51 of file diffLanguage.php.

$referenceMessages = $wgAllMessagesEn

Language messages we will use as reference.

By default 'en'

Definition at line 50 of file diffLanguage.php.

$testLanguage = ''

Definition at line 55 of file diffLanguage.php.

$testMessages = array()

Language messages we will test.

Definition at line 54 of file diffLanguage.php.

if (isset($options['help'])) $wgLanguageCode = ucfirstlcrest($wgLanguageCode)

This script run from the commandline.

Definition at line 48 of file diffLanguage.php.

foreach($referenceMessages as $index=> $ref)

Definition at line 143 of file diffLanguage.php.


Generated on Sat Sep 5 02:08:27 2009 for MediaWiki by  doxygen 1.5.9