2declare( strict_types = 1 );
4namespace MediaWiki\Extension\Translate\MessageProcessing;
28 $namespace = $sourceMessageHandle->
getTitle()->getNamespace();
30 $titles = self::getMatchingTitles( $sourceMessageHandle );
32 foreach ( $titles as $title ) {
37 if ( $handle->getKey() !== $sourceMessageHandle->
getKey() ) {
40 $targetTitle = Title::makeTitle(
42 TranslateUtils::title( $replacement, $handle->getCode(), $namespace )
44 $titlesForMove[] = [ $title, $targetTitle ];
47 return $titlesForMove;
50 private static function getMatchingTitles(
MessageHandle $handle ): TitleArray {
51 $dbr = wfGetDB( DB_PRIMARY );
54 $vars = [
'page_title',
'page_namespace',
'page_id' ];
56 $comparisonCond =
'page_title ' . $dbr->buildLike(
62 'page_namespace' => $handle->
getTitle()->getNamespace(),
65 $result = $dbr->select( $tables, $vars, $conds, __METHOD__ );
67 return TitleArray::newFromResult( $result );
Class for pointing to messages, like Title class is for titles.
getTitle()
Get the original title.
getTitleForBase()
Get the title for the page base.
getKey()
Returns the identified or guessed message key.
Essentially random collection of helper functions, similar to GlobalFunctions.php.