X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FI18n.class.php;h=ed7497d70856031df7962502458fbe88e8907c11;hb=75b65e92b21d45e2b09fb12daef169fb214a7acd;hp=7155edb0c2b2c855bf1cb255a4a55ce100b99910;hpb=da435f04300629fd13e7c2c90c3bbd3a8dc349aa;p=timetracker.git diff --git a/WEB-INF/lib/I18n.class.php b/WEB-INF/lib/I18n.class.php index 7155edb0..ed7497d7 100644 --- a/WEB-INF/lib/I18n.class.php +++ b/WEB-INF/lib/I18n.class.php @@ -35,23 +35,28 @@ 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; } + // getKey is a legacy function that we are replacing with get. + function getKey($kword) { + return $this->get($kword); + } + // TODO: refactoring ongoing down from here... function getWeekDayName($id) { $id = (int) $id;