Changeset 67 in subversion for trunk/roundcubemail/program/include/main.inc


Ignore:
Timestamp:
Oct 31, 2005 6:41:00 PM (8 years ago)
Author:
roundcube
Message:

Added Finnish, Romanian and Chinese translation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/main.inc

    r66 r67  
    227227function load_gui() 
    228228  { 
    229   global $CONFIG, $OUTPUT, $COMM_PATH, $IMAP, $JS_OBJECT_NAME; 
     229  global $CONFIG, $OUTPUT, $COMM_PATH, $JS_OBJECT_NAME, $sess_user_lang; 
    230230 
    231231  // init output page 
     
    238238  if (!empty($GLOBALS['_framed'])) 
    239239    $javascript .= "$JS_OBJECT_NAME.set_env('framed', true);\n"; 
    240  
     240     
    241241  $OUTPUT->add_script($javascript); 
    242242  $OUTPUT->include_script('program/js/common.js'); 
    243   $OUTPUT->include_script('program/js/app.js');   
     243  $OUTPUT->include_script('program/js/app.js'); 
     244 
     245  // set user-selected charset 
     246  if ($CONFIG['charset']) 
     247    $OUTPUT->set_charset($CONFIG['charset']); 
     248  else 
     249    rcmail_set_locale($sess_user_lang); 
    244250  }   
     251 
     252 
     253// set localization charset based on the given language 
     254function rcmail_set_locale($lang) 
     255  { 
     256  global $OUTPUT, $INSTLL_PATH; 
     257  static $rcube_charsets; 
     258 
     259  if (!$rcube_charsets) 
     260    @include($INSTLL_PATH.'program/localization/index.inc'); 
     261 
     262  if (isset($rcube_charsets[$lang])) 
     263    $OUTPUT->set_charset($rcube_charsets[$lang]); 
     264  else 
     265    $OUTPUT->set_charset('ISO-8859-1'); 
     266  } 
    245267 
    246268 
     
    448470  if (!sizeof($sa_languages)) 
    449471    { 
    450     @include_once($INSTLL_PATH.'program/localization/index.inc'); 
     472    @include($INSTLL_PATH.'program/localization/index.inc'); 
    451473 
    452474    if ($dh = @opendir($INSTLL_PATH.'program/localization')) 
Note: See TracChangeset for help on using the changeset viewer.