Index: branches/5.1.x/core/kernel/languages/phrases_cache.php =================================================================== diff -u -N -r13086 -r13151 --- branches/5.1.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 13086) +++ branches/5.1.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 13151) @@ -1,6 +1,6 @@ _phraseEditTemplate = 'regional/phrases_edit'; + $this->_phraseEditTemplate = 'languages/phrase_edit'; } /** @@ -158,9 +158,9 @@ return; } - $sql = 'SELECT Translation, PhraseKey + $sql = 'SELECT l' . $this->LanguageId . '_Translation, PhraseKey FROM ' . TABLE_PREFIX . 'Phrase - WHERE (LanguageId = ' . $this->LanguageId . ') AND PhraseId IN (' . implode(',', $ids) . ')'; + WHERE PhraseId IN (' . implode(',', $ids) . ')'; $this->Phrases = $this->Conn->GetCol($sql, 'PhraseKey'); /*foreach($phrases as $phrase => $tanslation) @@ -233,7 +233,7 @@ if ($this->_editExisting && $allow_editing && !array_key_exists($label, $this->_missingPhrases)) { // option to change translation for Labels - $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnPrepareUpdate\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});'; + $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnPreparePhrase\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});'; $translated_label = '<' . $this->_translateHtmlTag . ' href="' . $edit_url . '" name="cms-translate-phrase" title="Edit translation">' . $translated_label . '_translateHtmlTag . '>'; if ($this->fromTag) { @@ -260,16 +260,16 @@ $language_id = $use_admin ? $this->AdminLanguageId : $this->LanguageId; - $sql = 'SELECT PhraseId, Translation + $sql = 'SELECT PhraseId, l' . $language_id . '_Translation FROM ' . TABLE_PREFIX . 'Phrase - WHERE (LanguageId = ' . $language_id . ') AND (PhraseKey = ' . $this->Conn->qstr($label) . ')'; + WHERE (PhraseKey = ' . $this->Conn->qstr($label) . ') AND (l' . $language_id . '_Translation IS NOT NULL)'; $res = $this->Conn->GetRow($sql); if ($res === false || count($res) == 0) { $translation = '!' . $label . '!'; if ($this->_editMissing && $allow_editing) { - $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnNew\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});'; + $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnPreparePhrase\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});'; $translation = '<' . $this->_translateHtmlTag . ' href="' . $edit_url . '" name="cms-translate-phrase" title="Translate">!' . $label . '!_translateHtmlTag . '>'; if ($this->fromTag) { @@ -286,7 +286,7 @@ } $cache_key = ($allow_editing ? '' : 'NE:') . $label; - $this->Phrases[$cache_key] = $res['Translation']; + $this->Phrases[$cache_key] = $res['l' . $language_id . '_Translation']; array_push($this->Ids, $res['PhraseId']); $this->Ids = array_unique($this->Ids); // just to make sure