]> git.sur5r.net Git - bacula/bacula/blob - gui/bacula-web/lang.php
- Continue implementing migration.
[bacula/bacula] / gui / bacula-web / lang.php
1 <?
2 /* 
3 +-------------------------------------------------------------------------+
4 | Copyright (C) 2004-2005 Juan Luis Frances Jiminez                       |
5 |                                                                         |
6 | This program is free software; you can redistribute it and/or           |
7 | modify it under the terms of the GNU General Public License             |
8 | as published by the Free Software Foundation; either version 2          |
9 | of the License, or (at your option) any later version.                  |
10 |                                                                         |
11 | This program is distributed in the hope that it will be useful,         |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
14 | GNU General Public License for more details.                            |
15 +-------------------------------------------------------------------------+ 
16 */
17 // begin Gettext initialization
18 // and we check if it is present at the system
19
20 if ( function_exists("gettext") ) {
21         require($smarty_gettext_path."smarty_gettext.php");     
22         $smarty->register_block('t','smarty_translate');
23         
24         $vars = $smarty->get_config_vars();
25         $language = $vars['lang'];
26         $domain = "messages";   
27         putenv("LANG=$language"); 
28         setlocale(LC_ALL, $language);
29         bindtextdomain($domain,"./locale");
30         textdomain($domain);
31 }
32 else {
33         function smarty_translate($params, $text, &$smarty) {
34                 return $text;
35         }
36         $smarty->register_block('t','smarty_translate');
37 }
38 ?>