Browse Source

Changed _('String') into _("String") to help out the gettext stuff

Tyler Akins 24 năm trước cách đây
mục cha
commit
8266e5c308

+ 13 - 13
functions/abook_database.php

@@ -44,7 +44,7 @@
       
       // Constructor
       function abook_database($param) {
-         $this->sname = _('Personal address book');
+         $this->sname = _("Personal address book");
          
          if(is_array($param)) {
             if(empty($param['dsn']) || 
@@ -83,7 +83,7 @@
          $dbh = DB::connect($this->dsn, true);
          
          if(DB::isError($dbh) || DB::isWarning($dbh)) 
-            return $this->set_error(sprintf(_('Database error: %s'),
+            return $this->set_error(sprintf(_("Database error: %s"),
                                             DB::errorMessage($dbh)));
          
          $this->dbh = $dbh;
@@ -119,7 +119,7 @@
          $res = $this->dbh->query($query);
 
          if(DB::isError($res)) 
-            return $this->set_error(sprintf(_('Database error: %s'),
+            return $this->set_error(sprintf(_("Database error: %s"),
                                             DB::errorMessage($res)));
 
          while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
@@ -151,7 +151,7 @@
          $res = $this->dbh->query($query);
 
          if(DB::isError($res)) 
-            return $this->set_error(sprintf(_('Database error: %s'),
+            return $this->set_error(sprintf(_("Database error: %s"),
                                             DB::errorMessage($res)));
 
          if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
@@ -180,7 +180,7 @@
          $res = $this->dbh->query($query);
 
          if(DB::isError($res)) 
-            return $this->set_error(sprintf(_('Database error: %s'),
+            return $this->set_error(sprintf(_("Database error: %s"),
                                             DB::errorMessage($res)));
 
          while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
@@ -199,7 +199,7 @@
       // Add address
       function add($userdata) {
          if(!$this->writeable)
-            return $this->set_error(_('Addressbook is read-only'));
+            return $this->set_error(_("Addressbook is read-only"));
 
          if(!$this->open())
             return false;
@@ -207,7 +207,7 @@
          // See if user exist already
          $ret = $this->lookup($userdata['nickname']);
          if(!empty($ret))
-            return $this->set_error(sprintf(_('User \'%s\' already exist'), 
+            return $this->set_error(sprintf(_((User \'%s\' already exist"),
                                             $ret['nickname']));
 
          // Create query
@@ -226,14 +226,14 @@
          if($r == DB_OK) return true;
 
          // Fail
-         return $this->set_error(sprintf(_('Database error: %s'),
+         return $this->set_error(sprintf(_("Database error: %s"),
                                          DB::errorMessage($r)));
       }
 
       // Delete address
       function remove($alias) {
          if(!$this->writeable) 
-            return $this->set_error(_('Addressbook is read-only'));
+            return $this->set_error(_("Addressbook is read-only"));
 
          if(!$this->open())
             return false;
@@ -255,14 +255,14 @@
          if($r == DB_OK) return true;
 
          // Fail
-         return $this->set_error(sprintf(_('Database error: %s'),
+         return $this->set_error(sprintf(_("Database error: %s"),
                                          DB::errorMessage($r)));
       }
 
       // Modify address
       function modify($alias, $userdata) {
          if(!$this->writeable) 
-            return $this->set_error(_('Addressbook is read-only'));
+            return $this->set_error(_("Addressbook is read-only"));
 
          if(!$this->open())
             return false;
@@ -270,7 +270,7 @@
          // See if user exist
          $ret = $this->lookup($alias);
          if(empty($ret))
-            return $this->set_error(sprintf(_('User \'%s\' does not exist'), 
+            return $this->set_error(sprintf(_("User '%s' does not exist"),
                                             $alias));
 
          // Create query
@@ -291,7 +291,7 @@
          if($r == DB_OK) return true;
 
          // Fail
-         return $this->set_error(sprintf(_('Database error: %s'),
+         return $this->set_error(sprintf(_("Database error: %s"),
                                          DB::errorMessage($r)));
       }
    } // End of class abook_database

+ 15 - 15
functions/abook_local_file.php

@@ -31,7 +31,7 @@
 
      // Constructor
      function abook_local_file($param) {
-       $this->sname = _('Personal address book');
+       $this->sname = _("Personal address book");
        $this->umask = Umask();
 
        if(is_array($param)) {
@@ -39,7 +39,7 @@
 	   return $this->set_error('Invalid parameters');
 	 if(!is_string($param['filename']))
 	   return $this->set_error($param['filename'] . ': '.
-				   _('Not a file name'));
+				   _("Not a file name"));
 
 	 $this->filename = $param['filename'];
 
@@ -72,7 +72,7 @@
 
        // Check that new file exitsts
        if((!(file_exists($file) && is_readable($file))) && !$create)
-	 return $this->set_error("$file: " . _('No such file or directory'));
+	 return $this->set_error("$file: " . _("No such file or directory"));
 
        // Close old file, if any
        if($this->filehandle) $this->close();
@@ -92,7 +92,7 @@
 	   $this->filename   = $file;
 	   $this->writeable  = false;
 	 } else {
-	   return $this->set_error("$file: " . _('Open failed'));
+	   return $this->set_error("$file: " . _("Open failed"));
 	 }
        }
 
@@ -128,7 +128,7 @@
      function overwrite($rows) {
        $newfh = @fopen($this->filename, 'w');
        if(!$newfh)
-	 return $this->set_error("$file: " . _('Open failed'));
+	 return $this->set_error("$file: " . _("Open failed"));
 
        for($i = 0 ; $i < sizeof($rows) ; $i++) {
 	 if(is_array($rows[$i]))
@@ -224,12 +224,12 @@
      // Add address
      function add($userdata) {
        if(!$this->writeable) 
-	 return $this->set_error(_('Addressbook is read-only'));
+	 return $this->set_error(_("Addressbook is read-only"));
 
        // See if user exist already
        $ret = $this->lookup($userdata['nickname']);
        if(!empty($ret))
-	 return $this->set_error(sprintf(_('User \'%s\' already exist'), 
+	 return $this->set_error(sprintf(_("User '%s' already exist"),
 					 $ret['nickname']));
 
        // Here is the data to write
@@ -244,11 +244,11 @@
        // Reopen file, just to be sure
        $this->open(true);
        if(!$this->writeable) 
-	 return $this->set_error(_('Addressbook is read-only'));
+	 return $this->set_error(_("Addressbook is read-only"));
 
        // Lock the file
        if(!$this->lock())
-	 return $this->set_error(_('Could not lock datafile'));
+	 return $this->set_error(_("Could not lock datafile"));
 
        // Write
        $r = fwrite($this->filehandle, $data);
@@ -260,19 +260,19 @@
        if($r > 0) return true;
 
        // Fail
-       $this->set_error(_('Write to addressbook failed'));
+       $this->set_error(_("Write to addressbook failed"));
        return false;
      }
 
      // Delete address
      function remove($alias) {
        if(!$this->writeable) 
-	 return $this->set_error(_('Addressbook is read-only'));
+	 return $this->set_error(_("Addressbook is read-only"));
 
        // Lock the file to make sure we're the only process working
        // on it.
        if(!$this->lock())
-	 return $this->set_error(_('Could not lock datafile'));
+	 return $this->set_error(_("Could not lock datafile"));
 
        // Read file into memory, ignoring nicknames to delete
        $this->open();
@@ -297,18 +297,18 @@
      // Modify address
      function modify($alias, $userdata) {
        if(!$this->writeable) 
-	 return $this->set_error(_('Addressbook is read-only'));
+	 return $this->set_error(_("Addressbook is read-only"));
 
        // See if user exist
        $ret = $this->lookup($alias);
        if(empty($ret))
-	 return $this->set_error(sprintf(_('User \'%s\' does not exist'), 
+	 return $this->set_error(sprintf(_("User '%s' does not exist"),
 					 $alias));
 
        // Lock the file to make sure we're the only process working
        // on it.
        if(!$this->lock())
-	 return $this->set_error(_('Could not lock datafile'));
+	 return $this->set_error(_("Could not lock datafile"));
 
        // Read file into memory, modifying the data for the 
        // user identifyed by $alias

+ 1 - 1
functions/imap_messages.php

@@ -123,7 +123,7 @@
       
       $header = new small_header;
       if ($sent == true)
-         $header->from = (trim($to) != '')? $to : _('(only Cc/Bcc)');
+         $header->from = (trim($to) != '')? $to : _("(only Cc/Bcc)");
       else   
          $header->from = $from;
 

+ 2 - 2
functions/mime.php

@@ -544,7 +544,7 @@
             
             $body .= "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0 BGCOLOR=\"$color[0]\"><TR>\n";
             $body .= "<TH ALIGN=\"left\" BGCOLOR=\"$color[9]\"><B>\n";
-            $body .= _('Attachments') . ':';
+            $body .= _("Attachments") . ':';
             $body .= "</B></TH></TR><TR><TD>\n";
             
             $body .= "<TABLE CELLSPACING=0 CELLPADDING=1 BORDER=0>\n";
@@ -576,7 +576,7 @@
                   "../src/download.php?startMessage=$startMessage&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent";
                if ($where && $what)
                   $DefaultLink .= '&where=' . urlencode($where) . '&what=' . urlencode($what);
-               $Links['download link']['text'] = _('download');
+               $Links['download link']['text'] = _("download");
                $Links['download link']['href'] = 
                    "../src/download.php?absolute_dl=true&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent";
                $ImageURL = '';