Index: branches/5.0.x/core/kernel/languages/phrases_cache.php =================================================================== diff -u -N -r12734 -r12793 --- branches/5.0.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 12734) +++ branches/5.0.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 12793) @@ -1,6 +1,6 @@ LanguageId . ') AND PhraseId IN (' . implode(',', $ids) . ')'; - $this->Phrases = $this->Conn->GetCol($sql, 'Phrase'); + $this->Phrases = $this->Conn->GetCol($sql, 'PhraseKey'); /*foreach($phrases as $phrase => $tanslation) { @@ -242,7 +242,13 @@ function LoadPhraseByLabel($label, $original_label, $allow_editing = true) { - // bug: MySQL don't use index on Phrase column, when function is used on it's value (e.g. UPPER, like in this case) + if (!$allow_editing && !array_key_exists($label, $this->_missingPhrases) && array_key_exists($label, $this->Phrases)) { + // label is aready translated, but it's version without on the fly translation code is requested + $this->Phrases['NE:' . $label] = $this->Phrases[$label]; + + return true; + } + $sql = 'SELECT PhraseId, Translation FROM ' . TABLE_PREFIX . 'Phrase WHERE (LanguageId = ' . $this->LanguageId . ') AND (PhraseKey = ' . $this->Conn->qstr($label) . ')';