Index: branches/RC/core/kernel/languages/phrases_cache.php =================================================================== diff -u -N -r10580 -r11430 --- branches/RC/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 10580) +++ branches/RC/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 11430) @@ -17,7 +17,7 @@ var $LanguageId = null; var $fromTag = false; - + function PhrasesCache() { parent::kBase(); @@ -115,10 +115,10 @@ function GetPhrase($label) { - if (!isset($this->LanguageId)) return 'impossible case'; + if (!isset($this->LanguageId)) return 'impossible case'; //actually possible when custom field contains references to language labels and its being rebuilt in OnAfterConfigRead //which is triggered by Sections rebuild, which in turn read all the configs and all of that happens BEFORE seeting the language... - + if (ereg("^!.+!$", $label) > 0) { $label = substr($label, 1, -1); //cut exclamation marks @@ -147,6 +147,23 @@ } } + + if (defined('DEBUG_MODE') && DEBUG_MODE && + (($this->Application->IsAdmin() && constOn('DBG_PHRASES_EDIT_ADMIN')) || (!$this->Application->IsAdmin() && constOn('DBG_PHRASES_EDIT_FRONT')) ) ) { + // option to change translation for Labels + list($edit_tpl, $index_file) = $this->Application->IsAdmin() ? Array('regional/phrases_edit', 'index.php') : Array('phrases_edit', 'index.php'); + + if ($this->Application->IsAdmin() && $this->Application->ConfigValue('UsePopups')) { + // link to popup when using popups (only in admin) + $edit_url = 'javascript:translate_phrase(\''.addslashes($translated_label).'\', \''.$edit_tpl.'\');'; + } + else { + // direct link, when not using popups OR on frontend + $edit_url = $this->Application->HREF($edit_tpl,'',Array('m_opener'=>'d','phrases_label'=>$original_label,'phrases_event'=>'OnPrepareUpdate', 'pass'=>'all,phrases'), $index_file ); + } + $translated_label = '!'.$translated_label.'!'; + } + return $translated_label; }