Legoktm has uploaded a new change for review.
https://gerrit.wikimedia.org/r/87039
Change subject: Allow TPParse::getTranslationPageText to read from DB_SLAVE
......................................................................
Allow TPParse::getTranslationPageText to read from DB_SLAVE
There are usecases where a read from DB_MASTER isn't needed,
however if a DB type isn't provided it defaults back to
DB_MASTER.
Change-Id: Ic993a08e3ea1cf25d1b990d6dce8ded7b7818a0d
---
M tag/TPParse.php
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate
refs/changes/39/87039/1
diff --git a/tag/TPParse.php b/tag/TPParse.php
index f6f610a..b00ce0f 100644
--- a/tag/TPParse.php
+++ b/tag/TPParse.php
@@ -166,16 +166,17 @@
* Returns translation page with all possible translations replaced in
* and ugly translation tags removed.
* @param MessageCollection $collection Collection that holds
translated messages.
+ * @param int $dbtype One of DB_* constants.
* @return string Whole page as wikitext.
*/
- public function getTranslationPageText( $collection ) {
+ public function getTranslationPageText( $collection, $dbtype =
DB_MASTER ) {
$text = $this->template; // The source
// For finding the messages
$prefix = $this->title->getPrefixedDBKey() . '/';
if ( $collection instanceof MessageCollection ) {
- $collection->loadTranslations( DB_MASTER );
+ $collection->loadTranslations( $dbtype );
$collection->filter( 'translated', false );
}
--
To view, visit https://gerrit.wikimedia.org/r/87039
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic993a08e3ea1cf25d1b990d6dce8ded7b7818a0d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits