2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]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 \*=====================================================================*/
13 // ###################################################################
14 // LEXICAL STRING CONSTANTS
16 $lang->setlex('error_invalid_id', $lang->string('That is an invalid ID.'));
18 // ###################################################################
19 // fetches phrases from the system
20 function fetch_phrases($languageid, $forcexml = false
)
24 $language =& $bugsys->datastore
['language']["$languageid"];
28 if ($language['debug'] OR $forcexml)
30 if (!file_exists($language['filename']))
32 trigger_error('Cannot load XML strings file', E_USER_ERROR
);
35 $xmldata = file_get_contents($language['filename']);
36 if ($xmldata === false
)
38 trigger_error('Error reading XML strings file', E_USER_ERROR
);
41 $xml = $bugsys->xml
->parse($xmldata);
42 foreach ($xml['language']['phrase'] AS $phrase)
44 $locals[ $phrase['key']['value'] ] = $phrase['value']['value'];
49 $localizations = $bugsys->db
->query("SELECT * FROM " . TABLE_PREFIX
. "localization WHERE languageid = $languageid");
50 while ($local = $bugsys->db
->fetch_array($localizations))
52 $locals["$local[localkey]"] = $local['localtext'];
54 $bugsys->db
->free_result($localizations);
60 // ###################################################################
61 // determines the user's language
62 function fetch_user_language()
66 if ($bugsys->userinfo
['userid'])
68 $languageid = $bugsys->userinfo
['languageid'];
69 $language = $bugsys->datastore
['language']["$languageid"];
74 foreach ($bugsys->datastore
['language'] AS $language)
76 if ($language['default'])
78 $languageid = $language['languageid'];
79 $language = $bugsys->datastore
['language']["$languageid"];
85 $lang['id'] = $language['languageid'];
86 $lang['charset'] = $language['charset'];
87 $lang['direction'] = $language['direction'];
88 $lang['code'] = $language['languagecode'];
93 /*=====================================================================*\
94 || ###################################################################
97 || ###################################################################
98 \*=====================================================================*/