diff --git a/phpgwapi/inc/class.jscalendar.inc.php b/phpgwapi/inc/class.jscalendar.inc.php index da9958b7b0..ab5296287c 100644 --- a/phpgwapi/inc/class.jscalendar.inc.php +++ b/phpgwapi/inc/class.jscalendar.inc.php @@ -60,20 +60,20 @@ class jscalendar } } - /** + /** * return javascript needed for jscalendar - * - * Only needed if jscalendar runs outside of egw_framework, eg. in sitemgr - * - * @return string - */ - function get_javascript() - { - $args = array_intersect_key($GLOBALS['egw_info']['user']['preferences']['common'],array('lang'=>1,'dateformat'=>1)); - return -' - - + * + * Only needed if jscalendar runs outside of egw_framework, eg. in sitemgr + * + * @return string + */ + function get_javascript() + { + $args = array_intersect_key($GLOBALS['egw_info']['user']['preferences']['common'],array('lang'=>1,'dateformat'=>1)); + return +' + + '; } @@ -112,13 +112,16 @@ class jscalendar static $chars_shortcut; if (is_null($chars_shortcut)) $chars_shortcut = (int)lang('3 number of chars for month-shortcut'); // < 0 to take the chars from the end + $markuntranslated = translation::$markuntranslated; + translation::$markuntranslated = true; // otherwise we can not detect NOT translated phrases! $short = lang($m = adodb_date('M',$ts)); // check if we have a translation of the short-cut - if ($short == $m || $substr($short,-1) == '*') // if not generate one by truncating the translation of the long name + if ($substr($short,-1) == '*') // if not generate one by truncating the translation of the long name { $short = $chars_shortcut > 0 ? $substr(lang(adodb_date('F',$ts)),0,$chars_shortcut) : $substr(lang(adodb_date('F',$ts)),$chars_shortcut); } $date = str_replace(adodb_date('M',$ts),$short,$date); + translation::$markuntranslated = $markuntranslated; } } if ($helpmsg !== '') @@ -199,7 +202,7 @@ function todayClicked(calendar) { split[1] = "'.egw_time::to('now','Ymd').'"; hasdate = true; } - + if (split[1]) newsearch += split[0] + "=" + split[1]; else @@ -265,6 +268,8 @@ function monthClicked(calendar,monthstart) { { return False; } + $markuntranslated = translation::$markuntranslated; + translation::$markuntranslated = true; // otherwise we can not detect NOT translated phrases! $fields = preg_split('/[.\\/-]/',$datestr); foreach(preg_split('/[.\\/-]/',$this->dateformat) as $n => $field) { @@ -302,6 +307,8 @@ function monthClicked(calendar,monthstart) { } $date[$field] = (int)$fields[$n]; } + translation::$markuntranslated = $markuntranslated; + $ret = array( $year => $date['Y'], $month => $date['m'], diff --git a/phpgwapi/inc/jscalendar-setup.php b/phpgwapi/inc/jscalendar-setup.php index d1723f1627..60e8e953e3 100644 --- a/phpgwapi/inc/jscalendar-setup.php +++ b/phpgwapi/inc/jscalendar-setup.php @@ -23,7 +23,7 @@ $GLOBALS['egw_info'] = array( ); try { include('../../header.inc.php'); -} +} catch (egw_exception_no_permission_app $e) { // ignore exception, if home is not allowed, eg. for sitemgr } @@ -256,10 +256,12 @@ Calendar._SDN = new Array static $substr; if(is_null($substr)) $substr = function_exists('mb_substr') ? 'mb_substr' : 'substr'; $chars_shortcut = (int) lang('3 number of chars for day-shortcut'); // < 0 to take the chars from the end +$markuntranslated = translation::$markuntranslated; +translation::$markuntranslated = true; // otherwise we can not detect NOT translated phrases! foreach($day2int as $name => $n) { $short = lang($m = substr($name,0,3)); // test if our lang-file have a translation for the english short with 3 chars - if ($short == $m || $substr($short,-1) == '*') // else create one by truncating the full translation to x chars + if ($substr($short,-1) == '*') // else create one by truncating the full translation to x chars { $short = $chars_shortcut > 0 ? $substr(lang($name),0,$chars_shortcut) : $substr(lang($name),$chars_shortcut); } @@ -270,6 +272,7 @@ Calendar._SDN_len = $name) { @@ -279,16 +282,18 @@ foreach($monthnames as $n => $name) Calendar._SMN = new Array ( $name) { $short = lang($m = substr($name,0,3)); // test if our lang-file have a translation for the english short with 3 chars - if ($short == $m || $substr($short,-1) == '*') // else create one by truncating the full translation to x chars + if ($substr($short,-1) == '*') // else create one by truncating the full translation to x chars { $short = $chars_shortcut > 0 ? $substr(lang($name),0,$chars_shortcut) : $substr(lang($name),$chars_shortcut); } echo "\n \"".$short.'"'.($n < 11 ? ',' : ''); } +translation::$markuntranslated = $markuntranslated; ?>); Calendar._SMN_len = ;