Index: branches/5.0.x/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r12734 -r12871 --- branches/5.0.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 12734) +++ branches/5.0.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 12871) @@ -1,6 +1,6 @@ Application->isAdmin) { + $language_id = $this->Application->Phrases->LanguageId; + } + else { + $language_id = $this->Application->GetDefaultLanguageId(); // $this->Application->GetVar('m_lang'); + } + $sql = 'SELECT Locale FROM '. $this->Application->getUnitOption('lang', 'TableName') . ' - WHERE LanguageId = ' . $this->Application->GetDefaultLanguageId(); // $this->Application->GetVar('m_lang'); + WHERE LanguageId = ' . $language_id; $locale = strtolower( $this->Conn->GetOne($sql) ); if (file_exists(FULL_PATH . EDITOR_PATH . 'editor/lang/' . $locale . '.js')) { Index: branches/5.0.x/core/kernel/application.php =================================================================== diff -u -N -r12790 -r12871 --- branches/5.0.x/core/kernel/application.php (.../application.php) (revision 12790) +++ branches/5.0.x/core/kernel/application.php (.../application.php) (revision 12871) @@ -1,6 +1,6 @@ Phrases->GetPhrase($label, $allow_editing); + return $this->Phrases->GetPhrase($label, $allow_editing, $use_admin); } /** Index: branches/5.0.x/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r12808 -r12871 --- branches/5.0.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 12808) +++ branches/5.0.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 12871) @@ -1,6 +1,6 @@ -
' . $this->Application->Phrase('la_btn_EditContent', false) . ' '.(defined('DEBUG_MODE') && DEBUG_MODE ? " - #{$num}" : '').'
+
' . $this->Application->Phrase('la_btn_EditContent', false, true) . ' '.(defined('DEBUG_MODE') && DEBUG_MODE ? " - #{$num}" : '').'
'; @@ -1462,7 +1462,7 @@
-
' . $this->Application->Phrase('la_btn_SectionProperties', false) . '
+
' . $this->Application->Phrase('la_btn_SectionProperties', false, true) . '
' . "\n"; } elseif (EDITING_MODE == EDITING_MODE_DESIGN) { $url_params = Array( @@ -1487,21 +1487,21 @@
-
' . $this->Application->Phrase('la_btn_SaveChanges', false) . '
+
' . $this->Application->Phrase('la_btn_SaveChanges', false, true) . '
-
' . $this->Application->Phrase('la_btn_Cancel', false) . '
+
' . $this->Application->Phrase('la_btn_Cancel', false, true) . '
-
' . $this->Application->Phrase('la_btn_SectionTemplate', false) . '
+
' . $this->Application->Phrase('la_btn_SectionTemplate', false, true) . '
' . "\n"; } Index: branches/5.0.x/core/admin_templates/themes/extra_toolbar.tpl =================================================================== diff -u -N -r12495 -r12871 --- branches/5.0.x/core/admin_templates/themes/extra_toolbar.tpl (.../extra_toolbar.tpl) (revision 12495) +++ branches/5.0.x/core/admin_templates/themes/extra_toolbar.tpl (.../extra_toolbar.tpl) (revision 12871) @@ -9,7 +9,7 @@   - + Index: branches/5.0.x/core/install/english.lang =================================================================== diff -u -N -r12866 -r12871 --- branches/5.0.x/core/install/english.lang (.../english.lang) (revision 12866) +++ branches/5.0.x/core/install/english.lang (.../english.lang) (revision 12871) @@ -15,9 +15,12 @@ QXZhaWxhYmxlIENvbHVtbnM= QmFja2dyb3VuZA== Qm9yZGVycw== + QnJvd3NlIE1vZGU= Q2FuY2Vs Q2hhbmdl + Q29udGVudCBNb2Rl RGVsZXRl + RGVzaWduIE1vZGU= RG93bg== RWRpdA== RWRpdCBCbG9jaw== @@ -842,8 +845,8 @@ SW52YWxpZCBFLU1haWw= SW5jb3JyZWN0IGRhdGEgZm9ybWF0LCBwbGVhc2UgdXNlIGludGVnZXI= TWlzc2luZyBvciBpbnZhbGlkIEluLVBvcnRhbCBMaWNlbnNl - SW52YWxpZCBzdGF0ZQ== SW5jb3JyZWN0IFVzZXJuYW1lIG9yIFBhc3N3b3Jk + SW52YWxpZCBzdGF0ZQ== U2VjdGlvbnM= TGluayBEZXNjcmlwdGlvbg== RGlzcGxheSBlZGl0b3IgUElDS3MgYWJvdmUgcmVndWxhciBsaW5rcw== @@ -966,10 +969,10 @@ KEdNVCArMDk6MDAp UGFkZGluZ3M= UGFnZQ== + UGVuZGluZw== UGVyZm9ybWluZyBCYWNrdXA= UGVyZm9ybWluZyBJbXBvcnQ= UGVyZm9ybWluZyBSZXN0b3Jl - UGVuZGluZw== UmVhZC1Pbmx5IEFjY2VzcyBUbyBEYXRhYmFzZQ== Tm90IFRyYW5zbGF0ZWQ= VHJhbnNsYXRlZA== Index: branches/5.0.x/core/kernel/languages/phrases_cache.php =================================================================== diff -u -N -r12793 -r12871 --- branches/5.0.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 12793) +++ branches/5.0.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 12871) @@ -1,6 +1,6 @@ LanguageId = $this->Application->GetVar('m_lang'); + + if ($this->Application->GetVar('admin')) { + $admin_session =& $this->Application->recallObject('Session.admin'); + /* @var $admin_session Session */ + + $this->AdminLanguageId = $admin_session->GetField('Language'); + } } } @@ -199,7 +213,7 @@ } } - function GetPhrase($label, $allow_editing = true) + function GetPhrase($label, $allow_editing = true, $use_admin = false) { if (!isset($this->LanguageId)) { //actually possible when custom field contains references to language labels and its being rebuilt in OnAfterConfigRead @@ -235,12 +249,12 @@ return $translated_label; } - $this->LoadPhraseByLabel($label, $original_label, $allow_editing); + $this->LoadPhraseByLabel($label, $original_label, $allow_editing, $use_admin); return $this->GetPhrase($label, $allow_editing); } - function LoadPhraseByLabel($label, $original_label, $allow_editing = true) + function LoadPhraseByLabel($label, $original_label, $allow_editing = true, $use_admin = false) { 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 @@ -249,9 +263,11 @@ return true; } + $language_id = $use_admin ? $this->AdminLanguageId : $this->LanguageId; + $sql = 'SELECT PhraseId, Translation FROM ' . TABLE_PREFIX . 'Phrase - WHERE (LanguageId = ' . $this->LanguageId . ') AND (PhraseKey = ' . $this->Conn->qstr($label) . ')'; + WHERE (LanguageId = ' . $language_id . ') AND (PhraseKey = ' . $this->Conn->qstr($label) . ')'; $res = $this->Conn->GetRow($sql); if ($res === false || count($res) == 0) { Index: branches/5.0.x/core/units/sections/site_config_tp.php =================================================================== diff -u -N -r12734 -r12871 --- branches/5.0.x/core/units/sections/site_config_tp.php (.../site_config_tp.php) (revision 12734) +++ branches/5.0.x/core/units/sections/site_config_tp.php (.../site_config_tp.php) (revision 12871) @@ -1,6 +1,6 @@ Array ('image' => 'browse_site_mode', 'title' => 'Browse Mode'), - EDITING_MODE_CONTENT => Array ('image' => 'content_mode', 'title' => 'Content Mode'), - EDITING_MODE_DESIGN => Array ('image' => 'design_mode', 'title' => 'Design Mode'), + EDITING_MODE_BROWSE => Array ('image' => 'browse_site_mode', 'title' => 'la_btn_BrowseMode'), + EDITING_MODE_CONTENT => Array ('image' => 'content_mode', 'title' => 'la_btn_ContentMode'), + EDITING_MODE_DESIGN => Array ('image' => 'design_mode', 'title' => 'la_btn_DesignMode'), ); $site_config_helper =& $this->Application->recallObject('SiteConfigHelper');