r110367 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110366‎ | r110367 | r110368 >
Date:08:50, 31 January 2012
Author:nikerabbit
Status:resolved
Tags:i18nreview 
Comment:
When message definition changes, create new source entry instead of using the existing one which might be totally different now.
Modified paths:
  • /trunk/extensions/Translate/utils/TTMServer.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/utils/TTMServer.php
@@ -100,14 +100,21 @@
101101
102102 $dbw = $this->getDB( DB_MASTER );
103103 /* Check that the definition exists and fetch the sid. If not, add
104 - * the definition and retrieve the sid. */
105 - $conds = array( 'tms_context' => $title->getPrefixedText() );
 104+ * the definition and retrieve the sid. If the definition changes,
 105+ * we will create a new entry - otherwise we could at some point
 106+ * get suggestions which do not match the original definition any
 107+ * longer. The old translations are still kept until purged by
 108+ * rerunning the bootstrap script. */
 109+ $conds = array(
 110+ 'tms_context' => $title->getPrefixedText()
 111+ 'tms_text' => $definition,
 112+ );
106113 $sid = $dbw->selectField( 'translate_tms', 'tms_sid', $conds, __METHOD__ );
107114 if ( $sid === false ) {
108115 $sid = $this->insertSource( $title, $sourceLanguage, $definition );
109116 }
110117
111 - // Delete old translations for this message
 118+ // Delete old translations for this message if any. Could also use replace
112119 $deleteConds = array(
113120 'tmt_sid' => $sid,
114121 'tmt_lang' => $targetLanguage,

Follow-up revisions

RevisionCommit summaryAuthorDate
r110372Ping r110367 - comma etterronikerabbit10:08, 31 January 2012

Status & tagging log