Changeset 317

Show
Ignore:
Timestamp:
02/08/07 23:24:54 (2 years ago)
Author:
rats
Message:

- GUI:

  • changed behavior of string translation and added optional javascript variable

- SETUP:

  • modified Makefiles
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/BSDmakefile

    r154 r317  
    1           
     1 
    22.include <Makefile.inc> 
    33 
     
    99        $(SYSTEM_MAKE_DIRS) $(SYSTEM_LOG)/vhcs2-arpl-msgr 
    1010        $(SYSTEM_MAKE_DIRS) $(SYSTEM_VIRTUAL) 
     11        $(SYSTEM_MAKE_DIRS) $(SYSTEM_FCGI) 
    1112        $(SYSTEM_MAKE_DIRS) $(SYSTEM_MAIL_VIRTUAL) 
    1213        $(SYSTEM_MAKE_DIRS) $(SYSTEM_APACHE_BACK_LOG) 
    1314        cd ./configs && $(MAKE) install 
    14         cd ./engine && $(MAKE) install  
    15         cd ./gui && $(MAKE) install  
     15        cd ./engine && $(MAKE) install 
     16        cd ./gui && $(MAKE) install 
    1617        cd ./keys && $(MAKE) install 
    17          
     18 
    1819uninstall: 
    1920        cd ./tools && $(MAKE) uninstall 
    2021        cd ./configs && $(MAKE) uninstall 
    21         cd ./engine && $(MAKE) uninstall  
    22         cd ./gui && $(MAKE) uninstall  
     22        cd ./engine && $(MAKE) uninstall 
     23        cd ./gui && $(MAKE) uninstall 
    2324        cd ./keys && $(MAKE) uninstall 
    2425        rm -rf $(SYSTEM_CONF) 
     
    2627        rm -rf $(SYSTEM_LOG) 
    2728        rm -rf $(SYSTEM_VIRTUAL) 
     29        rm -rf $(SYSTEM_FCGI) 
    2830        rm -rf $(SYSTEM_MAIL_VIRTUAL) 
    2931        rm -rf $(SYSTEM_APACHE_BACK_LOG) 
    3032        rm -rf ./*~ 
    31          
     33 
  • trunk/CHANGELOG

    r312 r317  
    1717        - LANGUAGES: 
    1818                Spanish: added missing language strings 
     19        - GUI: 
     20                changed behavior of string translation and added optional javascript variable 
     21        - SETUP: 
     22                modified Makefiles 
    1923 
    20242007-02-08 Laurent DECLERCQ 
  • trunk/gui/client/email_accounts.php

    r154 r317  
    459459                        'TR_TOTAL_MAIL_ACCOUNTS' => tr('Mails total'), 
    460460                        'TR_DELETE' => tr('Delete'), 
    461                                                 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete'), 
     461                                                'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete', 1), 
    462462                     ) 
    463463              ); 
  • trunk/gui/include/i18n.php

    r288 r317  
    2626 *      @version                2.0 
    2727 *  @author                     VHCS Team, Benedikt Heintel (2007) 
     28 * 
     29 *      @param          $msgid          string to translate 
     30 *      @param          $js                     whether the input string is in javascript or not 
     31 *      @return                                 translated or original string 
    2832 **/ 
    29 function tr($msgid) { 
     33function tr($msgid, $js = false) { 
    3034        global $sql, $default_lang; 
    3135 
     
    3337 
    3438        if (!$sql) { 
    35                 return htmlentities($msgid, ENT_COMPAT, "UTF-8"); 
     39                return ($js ? $msgid : replace_html(htmlentities($msgid, ENT_COMPAT, "UTF-8"))); 
    3640        } 
    3741        else { 
     
    4549 
    4650                if (!$res) { 
    47                         return htmlentities($msgid, ENT_COMPAT, $encoding); 
     51                        return ($js ? $msgid : replace_html(htmlentities($msgid, ENT_COMPAT, $encoding))); 
    4852                } 
    4953                elseif ($res->RowCount() == 0) { 
    50                         return htmlentities($msgid, ENT_COMPAT, $encoding); 
     54                        return ($js ? $msgid : replace_html(htmlentities($msgid, ENT_COMPAT, $encoding))); 
    5155                } 
    5256                else { 
    5357                        $data = $res->FetchRow(); 
    5458                        if ($data['msgstr'] == '') { 
    55                                 return htmlentities($msgid, ENT_COMPAT, $encoding); 
     59                                return ($js ? $msgid : replace_html(htmlentities($msgid, ENT_COMPAT, $encoding))); 
    5660                        } 
    5761                        else { 
    58                                 return htmlentities($data['msgstr'], ENT_COMPAT, $encoding); 
     62                                return ($js ? $data['msgstr'] : replace_html(htmlentities($data['msgstr'], ENT_COMPAT, $encoding))); 
    5963                        } 
    6064                } 
     
    6266} 
    6367 
     68/** 
     69 *      Function:               replace_html 
     70 *      Description:    replaces special encoded strings back to their original signs 
     71 * 
     72 *      @access                 public 
     73 *      @version                1.0 
     74 *  @author                     VHCS Team, Benedikt Heintel (2007) 
     75 * 
     76 *      @param          $string         string to replace chars 
     77 *      @return                                 string with replaced chars 
     78 **/ 
     79function replace_html($string) { 
     80 
     81        $pattern = array ( 
     82                                                "=&lt;b&gt;=is", 
     83                                                "=&lt;/b&gt;=is", 
     84                                                "=&lt;i&gt;=is", 
     85                                                "=&lt;/i&gt;=is", 
     86                                                "=&lt;br&gt;=is" 
     87                                         ); 
     88 
     89        $replacement = array ( 
     90                                                        "<b>", 
     91                                                        "</b>", 
     92                                                        "<i>", 
     93                                                        "</i>", 
     94                                                        "<br />" 
     95                                                 ); 
     96 
     97        $string = preg_replace($pattern, $replacement, $string); 
     98 
     99        return $string; 
     100} 
     101 
    64102?>