From 977a295eb1e97e0c230063da40b8296fca778814 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 16 Dec 2005 15:05:41 -0500
Subject: [PATCH] Usage of virtusertable; mail_domain for new users; Chinese and Turkish localization

---
 CHANGELOG                            |    8 
 program/include/main.inc             |  109 ++++++
 program/steps/mail/compose.inc       |    2 
 config/main.inc.php.dist             |    7 
 program/localization/tr/labels.inc   |  176 +++++++++++
 program/localization/de/messages.inc |    2 
 program/localization/en/messages.inc |    2 
 program/localization/tr/messages.inc |   60 ++++
 index.php                            |    4 
 README                               |   17 +
 program/localization/cn/messages.inc |   63 ++++
 program/localization/cn/labels.inc   |  179 +++++++++++
 program/include/rcube_smtp.inc       |    3 
 SQL/postgres.initial.sql             |  126 ++++----
 .htaccess                            |    2 
 program/js/app.js                    |  122 +++++--
 program/localization/index.inc       |    3 
 17 files changed, 771 insertions(+), 114 deletions(-)

diff --git a/.htaccess b/.htaccess
index c0ab7f0..bb8fb50 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,6 +1,4 @@
 php_flag   display_errors 	On
-php_value  session.gc_maxlifetime  21600
-php_value  session.gc_divisor   500
 php_value  upload_max_filesize  2m
 
 <FilesMatch "(\.inc|\~)$|^_">
diff --git a/CHANGELOG b/CHANGELOG
index afadced..5f6e380 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,14 @@
 CHANGELOG RoundCube Webmail
 ---------------------------
 
+
+2005/12/16
+----------
+- Added Turkish and Simplified Chinese translation
+- Use virtusertable to resolve e-mail addresses at login
+- Configurable mail_domain used to compose correct e-mail addresses on first login
+
+
 2005/12/03
 ----------
 - Added Finnish, Romanian, Polish, Czech, British, Norwegian, Greek, Russian, Estonian and Chinese translation
diff --git a/README b/README
index 8d632cb..2a85bd0 100644
--- a/README
+++ b/README
@@ -1,5 +1,15 @@
 RoundCube Webmail (http://roundcube.net)
 
+
+ATTENTION
+---------
+This is just a snapshot of the current CVS repository and is NOT A STABLE
+version of RoundCube. There have been major changes since the latest release
+so please read the update instructions carefully. It's not recommended to
+replace an existing installation of RoundCube with this version. Also using
+a separate database or this installation is highly recommended.
+
+
 Introduction:
 -------------
 RoundCube Webmail is a browser-based multilingual IMAP client with an
@@ -43,7 +53,10 @@
 
 Contact:
 --------
-For any bug reports or feature requests please refer to the tracking system at sourceforge.net (http://sourceforge.net/tracker/?group_id=139281) or subscribe to our mailing list. See http://www.roundcube.net/?p=mailinglists for details.
+For any bug reports or feature requests please refer to the tracking system
+at sourceforge.net (http://sourceforge.net/tracker/?group_id=139281) or 
+subscribe to our mailing list. See http://www.roundcube.net/?p=mailinglists
+for details.
 
-Your also welcome to send a message to the project admin:
+You're always welcome to send a message to the project admin:
 roundcube@gmail.com
diff --git a/SQL/postgres.initial.sql b/SQL/postgres.initial.sql
index 4e74a22..554614e 100755
--- a/SQL/postgres.initial.sql
+++ b/SQL/postgres.initial.sql
@@ -1,3 +1,67 @@
+
+--
+-- Sequence "cache_ids"
+-- Name: cache_ids; Type: SEQUENCE; Schema: public; Owner: postgres
+--
+
+CREATE SEQUENCE cache_ids
+    INCREMENT BY 1
+    NO MAXVALUE
+    NO MINVALUE
+    CACHE 1;
+
+
+--
+-- Sequence "contact_ids"
+-- Name: contact_ids; Type: SEQUENCE; Schema: public; Owner: postgres
+--
+
+CREATE SEQUENCE contact_ids
+    START WITH 1
+    INCREMENT BY 1
+    NO MAXVALUE
+    NO MINVALUE
+    CACHE 1;
+
+
+--
+-- Sequence "identity_ids"
+-- Name: identity_ids; Type: SEQUENCE; Schema: public; Owner: postgres
+--
+
+CREATE SEQUENCE identity_ids
+    START WITH 1
+    INCREMENT BY 1
+    NO MAXVALUE
+    NO MINVALUE
+    CACHE 1;
+
+
+--
+-- Sequence "user_ids"
+-- Name: user_ids; Type: SEQUENCE; Schema: public; Owner: postgres
+--
+
+CREATE SEQUENCE user_ids
+    INCREMENT BY 1
+    NO MAXVALUE
+    NO MINVALUE
+    CACHE 1;
+
+
+--
+-- Sequence "message_ids"
+-- Name: message_ids; Type: SEQUENCE; Schema: public; Owner: postgres
+--
+
+CREATE SEQUENCE message_ids
+    INCREMENT BY 1
+    NO MAXVALUE
+    NO MINVALUE
+    CACHE 1;
+
+
+
 --
 -- Table "users"
 -- Name: users; Type: TABLE; Schema: public; Owner: postgres
@@ -158,66 +222,4 @@
 
 ALTER TABLE ONLY "messages"
     ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id);
-
-
---
--- Sequence "cache_ids"
--- Name: cache_ids; Type: SEQUENCE; Schema: public; Owner: postgres
---
-
-CREATE SEQUENCE cache_ids
-    INCREMENT BY 1
-    NO MAXVALUE
-    NO MINVALUE
-    CACHE 1;
-
-
---
--- Sequence "contact_ids"
--- Name: contact_ids; Type: SEQUENCE; Schema: public; Owner: postgres
---
-
-CREATE SEQUENCE contact_ids
-    START WITH 1
-    INCREMENT BY 1
-    NO MAXVALUE
-    NO MINVALUE
-    CACHE 1;
-
-
---
--- Sequence "identity_ids"
--- Name: identity_ids; Type: SEQUENCE; Schema: public; Owner: postgres
---
-
-CREATE SEQUENCE identity_ids
-    START WITH 1
-    INCREMENT BY 1
-    NO MAXVALUE
-    NO MINVALUE
-    CACHE 1;
-
-
---
--- Sequence "user_ids"
--- Name: user_ids; Type: SEQUENCE; Schema: public; Owner: postgres
---
-
-CREATE SEQUENCE user_ids
-    INCREMENT BY 1
-    NO MAXVALUE
-    NO MINVALUE
-    CACHE 1;
-
-
---
--- Sequence "message_ids"
--- Name: message_ids; Type: SEQUENCE; Schema: public; Owner: postgres
---
-
-CREATE SEQUENCE message_ids
-    INCREMENT BY 1
-    NO MAXVALUE
-    NO MINVALUE
-    CACHE 1;
 
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index ec1614e..dc14776 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -36,6 +36,13 @@
 // TCP port used for IMAP connections
 $rcmail_config['default_port'] = 143;
 
+// This domain will be used to form e-mail addresses of new users
+// Specify an array with 'host' => 'domain' values to support multiple hosts
+$rcmail_config['mail_domain'] = 'roundcube.net';
+
+// Path to a virtuser table file to resolve user names and e-mail addresses
+$rcmail_config['virtuser_file'] = '';
+
 // use this host for sending mails.
 // to use SSL connection, set ssl://smtp.host.com
 // if left blank, the PHP mail() function is used
diff --git a/index.php b/index.php
index 3141cab..ee65f8a 100644
--- a/index.php
+++ b/index.php
@@ -58,7 +58,9 @@
 
 ini_set('session.name', 'sessid');
 ini_set('session.use_cookies', 1);
-ini_set('error_reporting', E_ALL&~E_NOTICE);
+ini_set('session.gc_maxlifetime', 21600);
+ini_set('session.gc_divisor', 500);
+ini_set('error_reporting', E_ALL&~E_NOTICE); 
 
 // increase maximum execution time for php scripts
 // (does not work in safe mode)
diff --git a/program/include/main.inc b/program/include/main.inc
index 6c4591d..4cfb5b2 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -332,6 +332,11 @@
     $user = $sql_arr['username'];
     }
 
+  // try to resolve email address from virtuser table    
+  if (!empty($CONFIG['virtuser_file']) && strstr($user, '@'))
+    $user = rcmail_email2user($user);
+
+
   // exit if IMAP login failed
   if (!($imap_login  = $IMAP->connect($host, $user, $pass, $imap_port, $imap_ssl)))
     return FALSE;
@@ -388,19 +393,35 @@
 function rcmail_create_user($user, $host)
   {
   global $DB, $CONFIG, $IMAP;
-  
+
+  $user_email = '';
+
+  // try to resolve user in virtusertable
+  if (!empty($CONFIG['virtuser_file']) && strstr($user, '@')==FALSE)
+    $user_email = rcmail_user2email($user);
+
   $DB->query("INSERT INTO ".get_table_name('users')."
-              (created, last_login, username, mail_host, language)
-              VALUES (now(), now(), ?, ?, ?)",
+              (created, last_login, username, mail_host, alias, language)
+              VALUES (now(), now(), ?, ?, ?, ?)",
               $user,
               $host,
+              $user_email,
 		      $_SESSION['user_lang']);
 
   if ($user_id = $DB->insert_id(get_sequence_name('users')))
     {
-    $user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $host);
+    if (is_string($CONFIG['mail_domain']))
+      $mail_domain = $CONFIG['mail_domain'];
+    else if (is_array($CONFIG['mail_domain']) && isset($CONFIG['mail_domain'][$host]))
+      $mail_domain = $CONFIG['mail_domain'][$host];
+    else
+      $mail_domain = $host;
+   
+    if ($user_email=='')
+      $user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $mail_domain);
+
     $user_name = $user!=$user_email ? $user : '';
-    
+
     // also create a new identity record
     $DB->query("INSERT INTO ".get_table_name('identities')."
                 (user_id, del, standard, name, email)
@@ -433,6 +454,84 @@
   }
 
 
+// load virtuser table in array
+function rcmail_getvirtualfile()
+  {
+  global $CONFIG;
+  if (empty($CONFIG['virtuser_file']) || !is_file($CONFIG['virtuser_file']))
+    return FALSE;
+  
+  // read file 
+  $a_lines = file($CONFIG['virtuser_file']);
+  return $a_lines;
+  }
+
+
+// find matches of the given pattern in virtuser table
+function rcmail_findinvirtual($pattern)
+  {
+  $result = array();
+  $virtual = rcmail_getvirtualfile();
+  if ($virtual==FALSE)
+    return $result;
+
+  // check each line for matches
+  foreach ($virtual as $line)
+    {
+    $line = trim($line);
+    if (empty($line) || $line{0}=='#')
+      continue;
+      
+    if (eregi($pattern, $line))
+      $result[] = $line;
+    }
+
+  return $result;
+  }
+
+
+// resolve username with virtuser table
+function rcmail_email2user($email)
+  {
+  $user = $email;
+  $r = rcmail_findinvirtual("^$email");
+
+  for ($i=0; $i<count($r); $i++)
+    {
+    $data = $r[$i];
+    $arr = preg_split('/\s+/', $data);
+    if(count($arr)>0)
+      {
+      $user = trim($arr[count($arr)-1]);
+      break;
+      }
+    }
+
+  return $user;
+  }
+
+
+// resolve e-mail address with virtuser table
+function rcmail_user2email($user)
+  {
+  $email = "";
+  $r = rcmail_findinvirtual("$user$");
+
+  for ($i=0; $i<count($r); $i++)
+    {
+    $data=$r[$i];
+    $arr = preg_split('/\s+/', $data);
+    if (count($arr)>0)
+      {
+      $email = trim($arr[0]);
+      break;
+      }
+    }
+
+  return $email;
+  } 
+
+
 // overwrite action variable  
 function rcmail_overwrite_action($action)
   {
diff --git a/program/include/rcube_smtp.inc b/program/include/rcube_smtp.inc
index e4aea09..d337632 100644
--- a/program/include/rcube_smtp.inc
+++ b/program/include/rcube_smtp.inc
@@ -72,7 +72,8 @@
   // create Net_SMTP object and connect to server
   if (!is_object($smtp_conn))
     {
-    $SMTP_CONN = new Net_SMTP($smtp_host, $smtp_port, 'localhost');
+    $helo_host = !empty($_SERVER['server_name']) ? $_SERVER['server_name'] : 'localhost';
+    $SMTP_CONN = new Net_SMTP($smtp_host, $smtp_port, $helo_host);
 
     // set debugging
     if ($CONFIG['debug_level'] & 8)
diff --git a/program/js/app.js b/program/js/app.js
index a7445e2..213f62b 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -6,7 +6,7 @@
  | Copyright (C) 2005, RoundCube Dev, - Switzerland                      |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
- | Modified: 2005/12/14 (roundcube)                                      |
+ | Modified: 2005/12/16 (roundcube)                                      |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
@@ -312,6 +312,9 @@
       input_subject.focus();
     else if (input_message)
       this.set_caret2start(input_message); // input_message.focus();
+    
+    // get summary of all field values
+    this.cmp_hash = this.compose_field_hash();
     };
 
 
@@ -457,7 +460,13 @@
       // misc list commands
       case 'list':
         if (this.task=='mail')
+          {
+          // check input before leaving compose step
+          if (this.env.action=='compose' && this.cmp_hash != this.compose_field_hash() && !confirm(this.get_label('notsentwarning')))
+              break;
+
           this.list_mailbox(props);
+          }
         else if (this.task=='addressbook')
           this.list_contacts();
         break;
@@ -693,45 +702,8 @@
         if (!this.gui_objects.messageform)
           break;
           
-        // check input fields
-        var input_to = rcube_find_object('_to');
-        var input_subject = rcube_find_object('_subject');
-        var input_message = rcube_find_object('_message');
-
-        // check for empty recipient
-        if (input_to && !rcube_check_email(input_to.value, true))
-          {
-          alert(this.get_label('norecipientwarning'));
-          input_to.focus();
+        if (!this.check_compose_input())
           break;
-          }
-
-        // display localized warning for missing subject
-        if (input_subject && input_subject.value == '')
-          {
-          var subject = prompt(this.get_label('nosubjectwarning'), this.get_label('nosubject'));
-
-          // user hit cancel, so don't send
-          if (!subject && subject !== '')
-            {
-            input_subject.focus();
-            break;
-            }
-          else
-            {
-            input_subject.value = subject ? subject : this.get_label('nosubject');            
-            }
-          }
-
-        // check for empty body
-        if (input_message.value=='')
-          {
-          if (!confirm(this.get_label('nobodywarning')))
-            {
-            input_message.focus();
-            break;
-            }
-          }
 
         // all checks passed, send message
         this.set_busy(true, 'sendingmessage');
@@ -1348,6 +1320,78 @@
   /*********************************************************/
   
   
+  // checks the input fields before sending a message
+  this.check_compose_input = function()
+    {
+    // check input fields
+    var input_to = rcube_find_object('_to');
+    var input_subject = rcube_find_object('_subject');
+    var input_message = rcube_find_object('_message');
+
+    // check for empty recipient
+    if (input_to && !rcube_check_email(input_to.value, true))
+      {
+      alert(this.get_label('norecipientwarning'));
+      input_to.focus();
+      return false;
+      }
+
+    // display localized warning for missing subject
+    if (input_subject && input_subject.value == '')
+      {
+      var subject = prompt(this.get_label('nosubjectwarning'), this.get_label('nosubject'));
+
+      // user hit cancel, so don't send
+      if (!subject && subject !== '')
+        {
+        input_subject.focus();
+        return false;
+        }
+      else
+        {
+        input_subject.value = subject ? subject : this.get_label('nosubject');            
+        }
+      }
+
+    // check for empty body
+    if (input_message.value=='')
+      {
+      if (!confirm(this.get_label('nobodywarning')))
+        {
+        input_message.focus();
+        return false;
+        }
+      }
+
+    return true;
+    };
+    
+    
+  this.compose_field_hash = function()
+    {
+    // check input fields
+    var input_to = rcube_find_object('_to');
+    var input_cc = rcube_find_object('_to');
+    var input_bcc = rcube_find_object('_to');
+    var input_subject = rcube_find_object('_subject');
+    var input_message = rcube_find_object('_message');
+    
+    var str = '';
+    if (input_to && input_to.value)
+      str += input_to.value+':';
+    if (input_cc && input_cc.value)
+      str += input_cc.value+':';
+    if (input_bcc && input_bcc.value)
+      str += input_bcc.value+':';
+    if (input_subject && input_subject.value)
+      str += input_subject.value+':';
+    if (input_message && input_message.value)
+      str += input_message.value;
+
+    return str;
+    };
+    
+  
   this.change_identity = function(obj)
     {
     if (!obj || !obj.options)
diff --git a/program/localization/cn/labels.inc b/program/localization/cn/labels.inc
new file mode 100644
index 0000000..6d72f76
--- /dev/null
+++ b/program/localization/cn/labels.inc
@@ -0,0 +1,179 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | language/cn/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005, RoundQube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ |  Simplified-chinese utf-8 by winman 2005/12/6                         |
+ |  Author: winman rong  <winman.rong@gmail.com>                         |
+ +-----------------------------------------------------------------------+
+
+ $Id$
+
+*/
+
+$utf8_decoding = TRUE;
+
+$labels = array();
+
+// login page
+$labels['username']  = '用户名';
+$labels['password']  = '密码';
+$labels['server']    = '服务器';
+$labels['login']     = '登录';
+
+// taskbar
+$labels['logout']   = '退出';
+$labels['mail']     = '电子邮件';
+$labels['settings'] = '个人设置';
+$labels['addressbook'] = '地址薄';
+
+// mailbox names
+$labels['inbox']  = '收件箱';
+$labels['sent']   = '发件箱';
+$labels['trash']  = '垃圾桶';
+$labels['drafts'] = '早稿';
+$labels['junk']   = '垃圾邮件';
+
+// message listing
+$labels['subject'] = '邮件标题';
+$labels['from']    = '发件人';
+$labels['to']      = '接收人';
+$labels['cc']      = '副本';
+$labels['bcc']     = '密送';
+$labels['replyto'] = '回复地址';
+$labels['date']    = '日期';
+$labels['size']    = '文件大小';
+$labels['priority'] = '优先权';
+$labels['organization'] = '机构';
+
+// aliases
+$labels['reply-to'] = $labels['回复到'];
+
+$labels['mailboxlist'] = '文件夹';
+$labels['messagesfromto'] = 'Messages $from to $to of $count';
+$labels['messagenrof'] = 'Message $nr of $count';
+
+$labels['moveto']   = '移动到...';
+$labels['download'] = '下载';
+
+$labels['filename'] = '文件名称';
+$labels['filesize'] = '文件大小';
+
+$labels['preferhtml'] = '以HTML格式显示';
+$labels['htmlmessage'] = 'HTML格式邮件';
+$labels['prettydate'] = 'Pretty dates';
+
+$labels['addtoaddressbook'] = '加到地址薄';
+
+// weekdays short
+$labels['sun'] = '星期日';
+$labels['mon'] = '星期一';
+$labels['tue'] = '星期二';
+$labels['wed'] = '星期三';
+$labels['thu'] = '星期四';
+$labels['fri'] = '星期五';
+$labels['sat'] = '星期六';
+
+// weekdays long
+$labels['sunday']    = '星期日';
+$labels['monday']    = '星期一';
+$labels['tuesday']   = '星期二';
+$labels['wednesday'] = '星期三';
+$labels['thursday']  = '星期四';
+$labels['friday']    = '星期五';
+$labels['saturday']  = '星期六';
+
+$labels['today'] = '今天';
+
+// toolbar buttons
+$labels['writenewmessage']  = '写新邮件';
+$labels['replytomessage']   = '回复邮件';
+$labels['forwardmessage']   = '转发邮件';
+$labels['deletemessage']    = '把邮件移动到垃圾桶';
+$labels['printmessage']     = '打印这封邮件';
+$labels['previousmessages'] = '查看上一封邮件';
+$labels['nextmessages']     = '查看下一封邮件';
+$labels['backtolist']       = '返回邮件列表';
+$labels['viewsource']       = '显示源代码';
+
+$labels['select'] = '选择';
+$labels['all'] = '全部';
+$labels['none'] = '没有';
+$labels['unread'] = '还没读过的';
+
+// message compose
+$labels['compose']  = '写新邮件';
+$labels['sendmessage']  = '立刻发送邮件';
+$labels['addattachment']  = '附加一个文件';
+
+$labels['attachments'] = '附件';
+$labels['upload'] = '上传';
+$labels['close']  = '关闭';
+
+$labels['low']     = '低';
+$labels['lowest']  = '最低';
+$labels['normal']  = '正常';
+$labels['high']    = '高';
+$labels['highest'] = '最高';
+
+$labels['showimages'] = '显示图片';
+
+
+// address boook
+$labels['name']      = '显示名字';
+$labels['firstname'] = '名';
+$labels['surname']   = '姓';
+$labels['email']     = '电子邮件';
+
+$labels['addcontact'] = '增加新联系人';
+$labels['editcontact'] = '编辑联系信息';
+
+$labels['edit']   = '编辑';
+$labels['cancel'] = '取消';
+$labels['save']   = '保存';
+$labels['delete'] = '删除';
+
+$labels['newcontact']     = '建立新的联系信息';
+$labels['deletecontact']  = '删除所选择的联系信息';
+$labels['composeto']      = '给所选择的联系人发送邮件';
+$labels['contactsfromto'] = 'Contacts $from to $to of $count';
+$labels['print']          = '打印';
+$labels['export']         = '导出';
+
+
+// settings
+$labels['settingsfor']  = 'Settings for';
+
+$labels['preferences']  = '参数选择';
+$labels['userpreferences']  = '用户参数';
+$labels['editpreferences']  = '编辑用户参数';
+
+$labels['identities']  = '法件人标识';
+$labels['manageidentities']  = '管理帐号资料';
+$labels['newidentity']  = '建立新标识';
+
+$labels['newitem']  = 'New item';
+$labels['edititem']  = 'Edit item';
+
+$labels['setdefault']  = '设置为默认';
+$labels['language']  = '语言';
+$labels['timezone']  = '时区';
+$labels['pagesize']  = '每页行数';
+
+
+$labels['folders']  = '文件夹';
+$labels['foldername']  = '文件夹名称';
+$labels['subscribed']  = '显示与否';
+$labels['create']  = '创建';
+$labels['createfolder']  = '建立新文件夹';
+$labels['deletefolder']  = '删除文件夹';
+$labels['managefolders']  = '管理文件夹';
+
+
+?>
\ No newline at end of file
diff --git a/program/localization/cn/messages.inc b/program/localization/cn/messages.inc
new file mode 100644
index 0000000..49164d2
--- /dev/null
+++ b/program/localization/cn/messages.inc
@@ -0,0 +1,63 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | language/cn/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ |  Simplified-chinese utf-8 by winman 2005/12/6                         |
+ |  Author: winman rong  <winman.rong@gmail.com>                         |
+ +-----------------------------------------------------------------------+
+
+ $Id$
+
+*/
+
+$utf8_decoding = TRUE;
+
+$messages = array();
+
+$messages['loginfailed']  = '登录失败';
+
+$messages['cookiesdisabled'] = '你的浏览器目前关闭了cookies,请打开cookies再试';
+
+$messages['sessionerror'] = '当前 session 无效或者超时 ';
+
+$messages['imaperror'] = '不能连接IMAP服务器';
+
+$messages['nomessagesfound'] = '没有邮件在这个邮箱里';
+
+$messages['loggedout'] = '成功结束当前会话. 再见!';
+
+$messages['mailboxempty'] = '邮箱现在是空的';
+
+$messages['loadingdata'] = '读取数据...';
+
+$messages['messagesent'] = '邮件发送成功';
+
+$messages['successfullysaved'] = '保存成功';
+
+$messages['addedsuccessfully'] = '联系信息已经成功增加到地址薄';
+
+$messages['contactexists'] = '这个邮件地址已经存在';
+
+$messages['blockedimages'] = '为了保障你的私隐, 阻挡了这个邮件里的图片.';
+
+$messages['encryptedmessage'] = '这是个加密的邮件因此不能显示. 抱歉!';
+
+$messages['nocontactsfound'] = '没有发现联系人';
+
+$messages['sendingfailed'] = '邮件发送失败';
+
+$messages['errorsaving'] = '当发生错误时保存信息';
+
+$messages['errormoving'] = '移动邮件出错';
+
+$messages['errordeleting'] = '删除邮件出错';
+
+
+?>
\ No newline at end of file
diff --git a/program/localization/de/messages.inc b/program/localization/de/messages.inc
index 145c7b4..e54b896 100644
--- a/program/localization/de/messages.inc
+++ b/program/localization/de/messages.inc
@@ -70,4 +70,6 @@
 
 $messages['nobodywarning'] = 'Diese Nachricht ohne Inhalt senden?';
 
+$messages['notsentwarning'] = 'Ihre Nachricht wurde nicht gesendet. Wollen Sie die Nachricht verwerfen?';
+
 ?>
\ No newline at end of file
diff --git a/program/localization/en/messages.inc b/program/localization/en/messages.inc
index d0286e2..c1520ec 100644
--- a/program/localization/en/messages.inc
+++ b/program/localization/en/messages.inc
@@ -76,5 +76,7 @@
 
 $messages['nobodywarning'] = 'Send this message without text?';
 
+$messages['notsentwarning'] = 'Message has not been sent. Do you want to discard your message?';
+
 
 ?>
\ No newline at end of file
diff --git a/program/localization/index.inc b/program/localization/index.inc
index 82424e6..eef9ca2 100644
--- a/program/localization/index.inc
+++ b/program/localization/index.inc
@@ -26,7 +26,7 @@
 	'ar'    => 'Arabic',
 	'bg'    => 'Bulgarian',
 	'tw'    => 'Chinese (BIG5)',
-	'cn'    => 'Chinese(GB2312)',
+	'cn'    => 'Chinese (GB2312)',
 	'cz'    => 'Czech',
  	'ca'    => 'Catal&agrave;',
 	'da'    => 'Dansk',
@@ -64,6 +64,7 @@
 	'lv' => 'ISO-8859-2',
 	'pl' => 'ISO-8859-2',
 	'el' => 'ISO-8859-7',
+	'tr' => 'ISO-8859-9',
 	'tw' => 'BIG5',
 	'ja' => 'UTF-8'
 );
diff --git a/program/localization/tr/labels.inc b/program/localization/tr/labels.inc
new file mode 100644
index 0000000..9daa544
--- /dev/null
+++ b/program/localization/tr/labels.inc
@@ -0,0 +1,176 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | language/tr/labels.inc                                                |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005, RoundQube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Melih Ta�dizen <melih@marmara.edu.tr>                         |
+ +-----------------------------------------------------------------------+
+
+ $Id$
+
+*/
+
+$labels = array();
+
+// login page
+$labels['username']  = 'Kullan�c� Ad�';
+$labels['password']  = '�ifre';
+$labels['server']    = 'Sunucu';
+$labels['login']     = 'Giri�';
+
+// taskbar
+$labels['logout']   = '��k��';
+$labels['mail']     = 'E-Posta';
+$labels['settings'] = 'Ki�isel Ayarlar';
+$labels['addressbook'] = 'Adres Defteri';
+
+// mailbox names
+$labels['inbox']  = 'Gelen Kutusu';
+$labels['sent']   = 'G�nderilenler';
+$labels['trash']  = '��p';
+$labels['drafts'] = 'Taslaklar';
+$labels['junk']   = 'Gereksiz(spam)';
+
+// message listing
+$labels['subject'] = 'Konu';
+$labels['from']    = 'G�nderen';
+$labels['to']      = 'Al�c�';
+$labels['cc']      = 'Kopya';
+$labels['bcc']     = 'Gizli Kopya';
+$labels['replyto'] = 'Cevapla';
+$labels['date']    = 'Tarih';
+$labels['size']    = 'Boyut';
+$labels['priority'] = '�ncelik';
+$labels['organization'] = 'Organizasyon';
+
+// aliases
+$labels['reply-to'] = $labels['replyto'];
+
+$labels['mailboxlist'] = 'Klas�rler';
+$labels['messagesfromto'] = '$from\' dan/den $to\' e/a $count tane mesaj var.';
+$labels['messagenrof'] = '$nr / $count';
+
+$labels['moveto']   = '�uraya ta��...';
+$labels['download'] = '�ndir';
+
+$labels['filename'] = 'Dosya Ad�';
+$labels['filesize'] = 'Dosya Boyutu';
+
+$labels['preferhtml'] = 'HTML Tercih et';
+$labels['htmlmessage'] = 'HTML Mesaj';
+$labels['prettydate'] = 'Tarihleri Formatla';
+
+$labels['addtoaddressbook'] = 'Add to address book';
+
+// weekdays short
+$labels['sun'] = 'Paz';
+$labels['mon'] = 'Pts';
+$labels['tue'] = 'Sal';
+$labels['wed'] = '�ar';
+$labels['thu'] = 'Per';
+$labels['fri'] = 'Cum';
+$labels['sat'] = 'Cts';
+
+// weekdays long
+$labels['sunday']    = 'Pazar';
+$labels['monday']    = 'Pazartesi';
+$labels['tuesday']   = 'Sal�';
+$labels['wednesday'] = '�ar�amba';
+$labels['thursday']  = 'Per�embe';
+$labels['friday']    = 'Cuma';
+$labels['saturday']  = 'Cumartesi';
+
+$labels['today'] = 'Bug�n';
+
+// toolbar buttons
+$labels['writenewmessage']  = 'Yeni Mesaj';
+$labels['replytomessage']   = 'Cevapla';
+$labels['forwardmessage']   = '�let';
+$labels['deletemessage']    = '��p Klas�r�ne ta��';
+$labels['printmessage']     = 'Mesaj� Yazd�r';
+$labels['previousmessages'] = 'Sonraki mesajlar� g�ster';
+$labels['nextmessages']     = '�nceki mesajlar� g�ster';
+$labels['backtolist']       = 'Mesaj Listesi';
+$labels['viewsource']       = 'Kaynak Kodu G�ster';
+
+$labels['select'] = 'Se�';
+$labels['all'] = 'T�m�';
+$labels['none'] = 'Hi�biri';
+$labels['unread'] = 'Okunmam��';
+
+// message compose
+$labels['compose']  = 'Yeni Mesaj';
+$labels['sendmessage']  = 'Mesaj� g�nder';
+$labels['addattachment']  = 'Dosya ekle';
+
+$labels['attachments'] = 'Eklenmi� Dosyalar';
+$labels['upload'] = 'Y�kle';
+$labels['close']  = 'Kapat';
+
+$labels['low']     = 'Az�nemsiz';
+$labels['lowest']  = '�nemli';
+$labels['normal']  = 'Normal';
+$labels['high']    = '�nemli';
+$labels['highest'] = '�ok �nemli';
+
+$labels['showimages'] = 'Resimleri G�ster';
+
+
+// address boook
+$labels['name']      = 'G�r�nen �sim';
+$labels['firstname'] = 'Ad';
+$labels['surname']   = 'Soayad';
+$labels['email']     = 'E-Posta';
+
+$labels['addcontact'] = 'Yeni Kontak Ekle';
+$labels['editcontact'] = 'Kontak d�zenle';
+
+$labels['edit']   = 'D�zen';
+$labels['cancel'] = '�ptal';
+$labels['save']   = 'Kaydet';
+$labels['delete'] = 'Sil';
+
+$labels['newcontact']     = 'Yeni kontak ekle';
+$labels['deletecontact']  = 'Se�ili kontaklar� sil';
+$labels['composeto']      = '�u ki�iye mesaj yaz:';
+$labels['contactsfromto'] = '$from \'den/dan $to \'e/a $count tane mesaj var';
+$labels['print']          = 'Yazd�r';
+$labels['export']         = 'Farkl� kaydet';
+
+
+// settings
+$labels['settingsfor']  = 'Ayarlar:';
+
+$labels['preferences']  = 'Ayarlar';
+$labels['userpreferences']  = 'Kullan�c� Ayarlar�';
+$labels['editpreferences']  = 'Kullan�c� Ayarlar�n� D�zenle';
+
+$labels['identities']  = 'Kimlikler';
+$labels['manageidentities']  = 'Bu hesap i�in kimlikleri d�zenle';
+$labels['newidentity']  = 'Yeni Kimlik';
+
+$labels['newitem']  = 'Yeni ��e';
+$labels['edititem']  = '��eyi d�zenle';
+
+$labels['setdefault']  = 'Varsay�lan olarak ata';
+$labels['language']  = 'Dil';
+$labels['timezone']  = 'Zaman Dilimi';
+$labels['pagesize']  = 'Sayfada G�sterilecek Sat�r';
+
+
+$labels['folders']  = 'Klas�rler';
+$labels['foldername']  = 'Klas�r ad�';
+$labels['subscribed']  = 'Kay�tl�';
+$labels['create']  = 'Olu�tur';
+$labels['createfolder']  = 'Yeni klas�r olu�tur';
+$labels['deletefolder']  = 'Klas�r sl';
+$labels['managefolders']  = 'Klas�rleri d�zenle';
+
+
+?>
\ No newline at end of file
diff --git a/program/localization/tr/messages.inc b/program/localization/tr/messages.inc
new file mode 100644
index 0000000..a4fe9a8
--- /dev/null
+++ b/program/localization/tr/messages.inc
@@ -0,0 +1,60 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | language/tr/messages.inc                                              |
+ |                                                                       |
+ | Language file of the RoundCube Webmail client                         |
+ | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Melih Ta�dizen <melih@marmara.edu.tr>                         |
+ +-----------------------------------------------------------------------+
+
+ $Id$
+
+*/
+
+$messages = array();
+
+$messages['loginfailed']  = 'Ba�ar�s�z Giri�';
+
+$messages['cookiesdisabled'] = 'Taray�c�n�z�n Cerez(cookie) deste�i a��k de�il';
+
+$messages['sessionerror'] = 'Oturumunuz hatal� ve ya uzun s�re i�lem yapmad���n�z i�in kapand�';
+
+$messages['imaperror'] = 'IMAP sunucusuna ba�lan�lamad�';
+
+$messages['nomessagesfound'] = 'Gelen kutusnda mesaj yok';
+
+$messages['loggedout'] = 'Oturumunuz ba�ar�yla kapat�ld�. G�le G�le!';
+
+$messages['mailboxempty'] = 'Gelen kutusu bo�';
+
+$messages['loadingdata'] = 'Veri y�kleniyor...';
+
+$messages['messagesent'] = 'Mesaj g�nderildi';
+
+$messages['successfullysaved'] = 'Kaydedildi';
+
+$messages['addedsuccessfully'] = 'Kontak eklendi';
+
+$messages['contactexists'] = 'Bu e-posta adresine sahip bir kontak zaten kay�tl�';
+
+$messages['blockedimages'] = 'G�venli�iniz i�in harici resimler engellendi.';
+
+$messages['encryptedmessage'] = '�ifrelenm�i bir mesaj, okuyamazs�n�z!';
+
+$messages['nocontactsfound'] = 'Kontak bulunamad�';
+
+$messages['sendingfailed'] = 'Mesaj g�nderilemedi';
+
+$messages['errorsaving'] = 'Kaydederken hata olu�tu';
+
+$messages['errormoving'] = 'Mesaj ta��namad�';
+
+$messages['errordeleting'] = 'Mesaj silinemedi';
+
+
+?>
\ No newline at end of file
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 6aca28d..80a32a9 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -33,7 +33,7 @@
 
 
 // add some labels to client
-rcube_add_label('nosubject', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'sendingmessage');
+rcube_add_label('nosubject', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'sendingmessage', 'notsentwarning');
 
 
 if ($_GET['_reply_uid'] || $_GET['_forward_uid'])

--
Gitblit v1.9.1