From c472b0285b48fec443c08a0779f5d0ca8a0eef20 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 24 Sep 2005 00:33:42 +0000 Subject: [PATCH] Added localization system -- specific localities do not work, but the framework is there --- localize.php | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 localize.php diff --git a/localize.php b/localize.php new file mode 100644 index 0000000..dc4ab0f --- /dev/null +++ b/localize.php @@ -0,0 +1,95 @@ +lextable["$code"])) + { + return $this->lextable["$code"]; + } + + trigger_error('Lex code `' . $code . '` did not appear in the lex table', E_USER_ERROR); + } + + /** + * Sets a value in the lex table for easy access of strings + * that are commonly used + * + * @param str Lex code + * @param str Text equiv + */ + function setlex($code, $value) + { + if (isset($this->lextable["$code"])) + { + trigger_error('Cannot set lex `' . $code . '` : value already exists', E_USER_ERROR); + } + + $this->lextable["$code"] = $this->string($value); + } +} + +/*=====================================================================*\ +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ +?> \ No newline at end of file -- 2.22.5