Index: branches/5.1.x/core/units/phrases/phrases_event_handler.php =================================================================== diff -u -N -r14390 -r14537 --- branches/5.1.x/core/units/phrases/phrases_event_handler.php (.../phrases_event_handler.php) (revision 14390) +++ branches/5.1.x/core/units/phrases/phrases_event_handler.php (.../phrases_event_handler.php) (revision 14537) @@ -1,6 +1,6 @@ SetDBField('PhraseKey', mb_strtoupper($object->GetDBField('Phrase'))); - if ($object->GetOriginalField('Translation') != $object->GetDBField('Translation')) { + if ( $this->translationChanged($object) ) { $object->SetDBField('LastChanged_date', adodb_mktime() ); $object->SetDBField('LastChanged_time', adodb_mktime() ); $object->SetDBField('LastChangeIP', $_SERVER['REMOTE_ADDR']); @@ -279,6 +279,28 @@ } /** + * Checks, that at least one of phrase's translations was changed + * + * @param kDBItem $object + * @return bool + */ + function translationChanged(&$object) + { + $changed_fields = array_keys( $object->GetChangedFields() ); + $translation_fields = Array ('Translation', 'HintTranslation', 'ColumnTranslation'); + + foreach ($changed_fields as $changed_field) { + $changed_field = preg_replace('/^l[\d]+_/', '', $changed_field); + + if ( in_array($changed_field, $translation_fields) ) { + return true; + } + } + + return false; + } + + /** * Changes default module to custom (when available) * * @param kEvent $event