]> git.ipfire.org Git - thirdparty/sarg.git/blame - sarg-php/language.php
Mass commit of all the changes made between version 2.1 and 2.2.5. See ChangeLog...
[thirdparty/sarg.git] / sarg-php / language.php
CommitLineData
25697a35
GS
1<?php
2
3/*
d6e703cc
FM
4 * AUTHOR: Pedro Lineu Orso pedro.orso@gmail.com
5 * 1998, 2006
25697a35
GS
6 * SARG Squid Analysis Report Generator http://sarg-squid.org
7 *
8 * SARG donations:
9 * please look at http://sarg.sourceforge.net/donations.php
10 * ---------------------------------------------------------------------
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
25 *
26 */
27
28global $language;
29global $SargConf;
30
31function sarg_config($line,$clave) {
32 if ( 0 == strncmp("#", $line, 1))
33 return;
34 if (preg_match("/language/i", $line)) {
35 global $language;
36 $l = explode(' ', $line);
37 list(, $lang) = $l;
38 $lang=preg_replace('/\s+/','',$lang);
39 if ( 0 == strcmp("English", $lang))
40 $language = "en-EN";
41 else if ( 0 == strcmp("Portuguese", $lang))
42 $language = "pt_BR";
d6e703cc
FM
43 else if ( 0 == strcmp("French", $lang))
44 $language = "fr";
45 else if ( 0 == strcmp("Russian", $lang))
46 $language = "ru";
25697a35
GS
47 return;
48 }
49}
50
51
52$lines=file($SargConf);
53array_walk($lines,'sarg_config');
54
55putenv("LANG=$language");
56setlocale(LC_ALL, $language);
57$domain = 'messages';
58bindtextdomain($domain, "./locale");
59textdomain($domain);
60return;
61
62?>