]> src.bluestatic.org Git - bugdar.git/blob - includes/language.php
r1090: Adding canviewownhidden
[bugdar.git] / includes / language.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 // ###################################################################
23 // for those who don't have gettext
24
25 if (!function_exists('gettext'))
26 {
27 function gettext($str) { return $str; }
28 function _($str) { return $str; }
29 function bindtextdomain() {}
30 function textdomain() {}
31 function bind_textdomain_codeset() {}
32
33 $isso->debug('NOTICE: gettext not installed');
34 }
35
36 // ###################################################################
37 // LEXICAL STRING CONSTANTS
38
39 $lang->setlex('error_invalid_id', _('That is an invalid ID.'));
40
41 // ###################################################################
42 // determines the user's language
43 function fetch_user_language()
44 {
45 global $bugsys;
46
47 if ($bugsys->userinfo['userid'])
48 {
49 $languageid = $bugsys->userinfo['languageid'];
50 $language = $bugsys->datastore['language']["$languageid"];
51 }
52
53 if (!$languageid AND is_array($bugsys->datastore['language']))
54 {
55 foreach ($bugsys->datastore['language'] AS $language)
56 {
57 if ($bugsys->options['defaultlanguage'] == $language['languageid'])
58 {
59 $languageid = $language['languageid'];
60 $language = $bugsys->datastore['language']["$languageid"];
61 break;
62 }
63 }
64 }
65
66 $lang['id'] = $language['languageid'];
67 $lang['charset'] = $language['charset'];
68 $lang['direction'] = $language['direction'];
69 $lang['langcode'] = $language['langcode'];
70
71 return $lang;
72 }
73
74 /*=====================================================================*\
75 || ###################################################################
76 || # $HeadURL$
77 || # $Id$
78 || ###################################################################
79 \*=====================================================================*/
80 ?>