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) |
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.
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
string | $filename Filename of the file containing a message array | |
string | $languageCode Language of the external array |
Definition at line 100 of file diffLanguage.php.
getMediawikiMessages | ( | $ | languageCode = 'En' |
) |
ucfirstlcrest | ( | $ | string | ) |
Return a given string with first letter upper case, the rest lowercase.
Definition at line 66 of file diffLanguage.php.
usage | ( | ) |
Definition at line 61 of file diffLanguage.php.
Referenced by userOptions::showUsageAndExit().
$externalRef = false |
$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() |
if (isset($options['help'])) $wgLanguageCode = ucfirstlcrest($wgLanguageCode) |
foreach($referenceMessages as $index=> $ref) |
Definition at line 143 of file diffLanguage.php.