X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FI18n.class.php;h=7eb6228ffe5cbde537669fc35726eb14498926c3;hb=HEAD;hp=fd158f58c778324ecb39678fa7896c3c5b469282;hpb=ad89dda4fdde5dd9be57cfe0f1f7ec609acf02b6;p=timetracker.git diff --git a/WEB-INF/lib/I18n.class.php b/WEB-INF/lib/I18n.class.php index fd158f58..7eb6228f 100644 --- a/WEB-INF/lib/I18n.class.php +++ b/WEB-INF/lib/I18n.class.php @@ -35,19 +35,19 @@ class I18n { var $holidays; var $keys = array(); // These are our localized strings. - // The getKey obtains localized keyword value. - function getKey($kword) { + // get - obtains a localized value from $keys array. + function get($key) { $value = ''; - $pos = strpos($kword, '.'); // Keywords can have separating dots such as in form.login.about. + $pos = strpos($key, '.'); // Keywords can have separating dots such as in form.login.about. if (!($pos === false)) { - $words = explode('.', $kword); + $words = explode('.', $key); $str = ''; foreach ($words as $word) { $str .= "['".$word."']"; } eval("\$value = \$this->keys".$str.";"); } else { - $value = $this->keys[$kword]; + $value = $this->keys[$key]; } return $value; } @@ -70,9 +70,6 @@ class I18n { $this->weekdayNames = $i18n_weekdays; $this->weekdayShortNames = $i18n_weekdays_short; - if (defined('SHOW_HOLIDAYS') && isTrue(SHOW_HOLIDAYS)) { - $this->holidays = $i18n_holidays; - } foreach ($i18n_key_words as $kword=>$value) { $pos = strpos($kword, "."); @@ -97,9 +94,7 @@ class I18n { $this->monthNames = $i18n_months; $this->weekdayNames = $i18n_weekdays; $this->weekdayShortNames = $i18n_weekdays_short; - if (defined('SHOW_HOLIDAYS') && isTrue(SHOW_HOLIDAYS)) { $this->holidays = $i18n_holidays; - } foreach ($i18n_key_words as $kword=>$value) { if (!$value) continue; $pos = strpos($kword, ".");