Index: trunk/core/units/languages/languages_tag_processor.php
===================================================================
diff -u -N -r7635 -r8437
--- trunk/core/units/languages/languages_tag_processor.php (.../languages_tag_processor.php) (revision 7635)
+++ trunk/core/units/languages/languages_tag_processor.php (.../languages_tag_processor.php) (revision 8437)
@@ -33,12 +33,17 @@
*/
function CurrentDate($params)
{
- $week_day = $this->Application->Phrase('lu_weekday_'.adodb_date('l'));
- $format = str_replace('l', '#@#', $params['format']); // replace with reserved char (preserves translation link)
-
- return str_replace('#@#', $week_day, adodb_date($format));
+ $format = $params['format'];
+ if (strpos($format, 'l') !== false) {
+ $week_day = $this->Application->Phrase('lu_weekday_'.adodb_date('l'));
+ $format = str_replace('l', '#@#', $format); // replace with reserved char (preserves translation link)
+
+ return str_replace('#@#', $week_day, adodb_date($format));
+ }
+
+ return adodb_date($format);
}
-
+
function ListLanguages($params)
{
$this->Special = 'enabled';
@@ -50,11 +55,11 @@
$object =& $this->getObject($params);
return $this->Application->Phrase($params['phrase_prefix'].$object->GetDBField('PackName'));
}
-
+
function LanguageLink($params)
{
$t = $this->SelectParam($params, 'template,t');
-
+
$object =& $this->getObject($params);
return $this->Application->HREF($t, '', Array('m_lang' => $object->GetID()));
}
@@ -92,12 +97,12 @@
{
return $this->TotalRecords($params) > 1;
}
-
+
function IsPrimaryLanguage($params)
{
return $this->Application->GetDefaultLanguageId() == $this->Application->GetVar('m_lang');
}
-
+
/* function Main_IsMetricUnits($params)
{
$object =& $this->Application->recallObject($this->Prefix.'.current');
Index: trunk/core/kernel/languages/phrases_cache.php
===================================================================
diff -u -N -r8402 -r8437
--- trunk/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 8402)
+++ trunk/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 8437)
@@ -74,6 +74,11 @@
return is_array($this->Ids) && count($this->Ids) > 0 && $this->Ids != $this->OriginalIds;
}
+ /**
+ * Copy from Application->UpdateCache method
+ *
+ * @deprecated
+ */
function UpdateCache()
{
$update = false;
@@ -107,8 +112,8 @@
$translated_label = $this->Phrases[$label];
// debug mode is checked directly to improve performance
if (defined('DEBUG_MODE') && DEBUG_MODE && constOn('DBG_PHRASES_HIGHLIGHT')) {
- if (!$this->Application->isDebugMode()) return $translated_label;
-
+ if (!$this->Application->isDebugMode()) return $translated_label;
+
if ($this->Application->IsAdmin()) {
$sql = 'SELECT Module
FROM '.TABLE_PREFIX.'Phrase
@@ -120,7 +125,7 @@
// highlight text created via translated phrase (used to detect if text on screen is phrase or not)
$translated_label = ''.$translated_label.' '.$original_label.'';
}
-
+
}
return $translated_label;
}
@@ -150,7 +155,7 @@
// 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'=>'OnNew', 'pass'=>'all,phrases'), $index_file );
}
-
+
$translation = '!'.$label.'!';
if($this->fromTag) $translation = $this->escapeTagReserved($translation);
}