Index: trunk/extensions/Translate/utils/TTMServer.php |
— | — | @@ -100,14 +100,21 @@ |
101 | 101 | |
102 | 102 | $dbw = $this->getDB( DB_MASTER ); |
103 | 103 | /* 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 | + ); |
106 | 113 | $sid = $dbw->selectField( 'translate_tms', 'tms_sid', $conds, __METHOD__ ); |
107 | 114 | if ( $sid === false ) { |
108 | 115 | $sid = $this->insertSource( $title, $sourceLanguage, $definition ); |
109 | 116 | } |
110 | 117 | |
111 | | - // Delete old translations for this message |
| 118 | + // Delete old translations for this message if any. Could also use replace |
112 | 119 | $deleteConds = array( |
113 | 120 | 'tmt_sid' => $sid, |
114 | 121 | 'tmt_lang' => $targetLanguage, |