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
$filename | String: filename of the file containing a message array | |
$languageCode | String: 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.
Referenced by Parser_DiffTest::__call(), MimeMagic::__construct(), LoadBalancer::__construct(), DiffHistoryBlob::__sleep(), DiffHistoryBlob::__wakeup(), MWMemcached::_connect_sock(), _DiffEngine::_diag(), _DiffEngine::_shift_boundaries(), ApiQuerySiteinfo::appendDbReplLagInfo(), SiteConfiguration::arrayMerge(), benchmarkForm(), BenchmarkPurge::benchSquid(), Parser::braceSubstitution(), MacBinary::calcCRC(), Profiler::calltreeCount(), Status::cleanParams(), DiffHistoryBlob::compress(), compressWithConcat(), ZhClient::convertToAllVariants(), DatabaseSqlite::dataSeek(), DateFormatter::DateFormatter(), Services_JSON::decode(), FixSlaveDesync::desyncFixPage(), MimeMagic::detectMimeType(), WikiDiff3::diff(), RecompressTracked::dispatch(), do_copy_newtalk_to_watchlist(), RecompressTracked::doAllOrphans(), RecompressTracked::doAllPages(), Parser::doHeadings(), PopulateCategory::doPopulateCategory(), Parser::doQuotes(), RefreshLinks::doRefreshLinks(), CleanUpTest::doTestBytes(), DatabaseOracle::duplicateTableStructure(), ConfEditor::endPath(), PPFuzzTester::execute(), PopulateSha1::execute(), mcTest::execute(), DatabaseLag::execute(), GetSlaveServer::execute(), FixSlaveDesync::execute(), DeleteImageCache::execute(), ApiUndelete::execute(), ApiProtect::execute(), StringUtils::explodeMarkup(), SpecialVersion::extensionCredits(), UtfNormal::fastCombiningSort(), UtfNormal::fastCompose(), UtfNormal::fastDecompose(), DatabaseMysql::fieldInfo(), DatabaseMssql::fieldInfo(), ForeignAPIRepo::fileExistsBatch(), DatabaseIbm_db2::fillPrepared(), Maintenance::finalSetup(), Parser::findColonNoLinks(), FixSlaveDesync::findPageLatestCorruption(), CdbWriter_PHP::finish(), ForkController::forkWorkers(), ArrayDiffFormatter::format(), LogPage::formatBlockFlags(), Parser::formatHeadings(), MWMemcached::get_sock(), LoadBalancer::getAnyOpenConnection(), MagicWordArray::getBaseRegex(), IndexPager::getBody(), ImageHistoryPseudoPager::getBody(), MWNamespace::getCanonicalIndex(), Parser::getCommon(), LoadBalancer::getConnection(), FSRepo::getDeletedHashPath(), Profiler::getFunctionReport(), FileRepo::getHashPathForLevel(), LoadMonitor_MySQL::getLagTimes(), LoadBalancer::getMasterPos(), LoadBalancer::getMaxLag(), MimeMagic::getMediaType(), languages::getMessagesWithDubiousLinks(), DateFormatter::getMonthRegex(), LoadBalancer::getRandomNonLagged(), LoadBalancer::getReaderIndex(), LoadBalancer::getServerInfo(), LoadBalancer::getServerName(), MagicWord::getSynonym(), UploadBase::getTitle(), CdbFunctions::hash(), LoadBalancer::haveIndex(), Language::hebrewNumeral(), MacBinary::hexdump(), Parser_DiffTest::init(), DatabaseMssql::insert(), Http::isLocalURL(), LoadBalancer::isNonZeroLoad(), SpecialBookSources::isValidISBN(), PPNode_Hash_Array::item(), PPNode_DOM::item(), RecompressTracked::killSlaveProcs(), WikiDiff3::lcs_rec(), Language::listToText(), MessageCache::lock(), GenerateSitemap::main(), PPFuzzTester::makeInputText(), EditPage::makesafe(), MappedDiff::MappedDiff(), Parser::markerSkipCallback(), LocalFile::migrateThumbFile(), Xml::monthSelector(), SquidUpdate::newFromTitles(), ConfEditor::nextPath(), DatabaseMysql::open(), DatabaseMssql::open(), LoadBalancer::openConnection(), LoadBalancer::openForeignConnection(), ImagePage::openShowImage(), QueryPage::outputResults(), ImageQueryPage::outputResults(), BacklinkCache::partitionResult(), LoadBalancer::pickRandom(), UtfNormal::placebo(), populateCategory(), SpecialSearch::powerSearchBox(), Preprocessor_Hash::preprocessToObj(), FSRepo::publishBatch(), UtfNormal::quickIsNFC(), UtfNormal::quickIsNFCVerify(), User::randomPassword(), randomString(), BenchmarkPurge::randomTitle(), BenchmarkPurge::randomUrlList(), GIFMetadataExtractor::readGCT(), DateFormatter::reformat(), Profiler::remapCallTree(), MathRenderer::render(), RegexlikeReplacer::replace(), Parser::replaceExternalLinks(), ConfEditor::replaceSourceRegion(), Language::romanNumeral(), ParserUnitTest::run(), SquidPurgeClientPool::run(), ParserTest::runTests(), Parser_DiffTest::setFunctionHook(), splitHash(), RecompressTracked::startSlaveProcs(), Parser::statelessFetchTemplate(), FSRepo::storeBatch(), MediaWikiParserTestSuite::suite(), IPTest::testBogusIPs(), CdbTest::testCdb(), IPTest::testInvalidIPs(), IPTest::testValidIPs(), ImageGallery::toHTML(), Licenses::trimStars(), Language::tsToHebrew(), Language::tsToIranian(), EditPage::unmakesafe(), utf8ToCodepoint(), LoadBalancer::waitFor(), wfAbruptExit(), wfBaseConvert(), wfCountDown(), wfGetIP(), wfHtmlValidationHandler(), wfIsBadImage(), wlCutoffLinks(), DumpMultiWriter::writeClosePage(), DumpMultiWriter::writeCloseStream(), DumpMultiWriter::writeOpenPage(), DumpMultiWriter::writeOpenStream(), DumpMultiWriter::writeRevision(), and CleanUpTest::XtestAllChars().
$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(), Parser::addTrackingCategory(), OutputPage::blockedPage(), ProtectionForm::buildForm(), CdbTest::cdbAssert(), ExtensionInstaller::confirm(), RecompressTracked::critical(), RecompressTracked::debug(), ApiQueryTags::doTag(), SpecialResetpass::error(), ConfEditor::error(), OutputPage::errorpage(), TableDiffFormatter::escapeWhiteSpace(), MoveBatch::execute(), SpecialListGroupRights::execute(), ApiQueryAllmessages::execute(), SpecialNewpages::filterLinks(), ChangesList::flag(), LogPage::formatBlockFlag(), SpecialVersion::formatCredits(), Block::formatExpiry(), IPUnblockForm::formatRow(), Language::formatSize(), getCategoryLinks(), getCopyright(), Interwiki::getDescription(), SpecialUpload::getDupeWarning(), SpecialWhatLinksHere::getFilterPanel(), SpecialStatistics::getGroupStats(), RevisionDeleter::getLogMessage(), Language::getMessageFromDB(), Interwiki::getName(), ProtectionForm::getOptionLabel(), getUndeleteLink(), Status::hasMessage(), QuickTemplate::haveMsg(), RecompressTracked::info(), Article::info(), ChangesList::insertMove(), SpecialWhatLinksHere::listItem(), RecompressTracked::logToFile(), LoginForm::mainLoginForm(), ApiQuery::makeHelpMsg(), ApiBase::makeHelpMsg(), ApiQuery::makeHelpMsgHelper(), ApiBase::makeHelpMsgParameters(), LoginForm::makeLanguageSelector(), OutputPage::output(), Maintenance::outputChanneled(), SpecialPage::outputHeader(), LogEventsList::preCacheMessages(), HistoryPage::preCacheMessages(), ChangesList::preCacheMessages(), ImagePage::printSharedImageText(), ExtensionInstaller::prompt(), ApiMain::reallyMakeHelpMsg(), EnhancedChangesList::recentChangesLine(), RunJobs::runJobsLog(), ApiQueryBase::setContinueEnumParameter(), EditPage::setHeaders(), RevDel_List::setVisibility(), ApiBase::setWarning(), Article::showDeletedRevisionHeader(), DifferenceEngine::showDiffPage(), OutputPage::showErrorPage(), IPBlockForm::showForm(), ProtectedTitlesForm::showList(), ProtectedPagesForm::showList(), IPUnblockForm::showList(), Article::showNamespaceHeader(), EditPage::showTosSummary(), SpecialUpload::showUploadWarning(), ChangeTags::tagDescription(), wfBacktrace(), wfDebugDieBacktrace(), wfDie(), wfSpecialEmailuser(), wfThumbError(), and wfWarn().
$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.