2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Iris Studios Shared Object Framework [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
20 $OBJECT = 'Localization System';
27 * This framework handles localization. Localization in new ISSO
28 * applications is done through this framework. Nearly all strings
29 * are passed to the string function, which looks up the string in
30 * a .strings.xml file during runtime. Before release, a C tool
31 * creates the .strings.xml file for translators. Common strings
32 * can be accessed through the get lex function which calls a string
33 * based on unique identifier; this is useful for commonly used strings.
35 * @author Iris Studios, Inc.
36 * @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc.
44 * The lex lookup table
47 var $lextable = array();
55 * Returns a value from the lex table for a specific code
59 * @return str Localized string
61 function getlex($code)
63 if (isset($this->lextable
["$code"]))
65 return $this->lextable
["$code"];
68 trigger_error('Lex code `' . $code . '` did not appear in the lex table', E_USER_ERROR
);
72 * Sets a value in the lex table for easy access of strings
73 * that are commonly used
76 * @param str Text equiv
78 function setlex($code, $value)
80 if (isset($this->lextable
["$code"]))
82 trigger_error('Cannot set lex `' . $code . '` : value already exists', E_USER_ERROR
);
85 $this->lextable
["$code"] = $this->string($value);
89 /*=====================================================================*\
90 || ###################################################################
93 || ###################################################################
94 \*=====================================================================*/