Add ability to show login error from the IMAP server instead of traditional "Unknown...
[squirrelmail.git] / plugins / translate / functions.php
index 0d22c64cf35a326951d34540a5575bcb6d8799ee..f7682e548509a99496e17dc60388e6eee659360d 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * SquirrelMail translate plugin functions
  *
- * @copyright © 2004-2006 The SquirrelMail Project Team
+ * @copyright 2004-2014 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -13,8 +13,7 @@
 /**
  * do not allow to call this file directly
  */
-if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) ||
-     (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) {
+if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) {
     header("Location: ../../src/login.php");
     die();
 }
@@ -93,7 +92,7 @@ function translate_read_form_function() {
     $trans_ar = $message->findDisplayEntity(array(), array('text/plain'));
     $body = '';
     $final_body = '';
-    if ($trans_ar[0] != '') {
+    if ( !empty($trans_ar[0]) ) {
         for ($i = 0; $i < count($trans_ar); $i++) {
             /* reduced version of formatBody and translateText functions */
 
@@ -457,7 +456,7 @@ function translate_new_form($action,$charset=null) {
     }
 
     if (! is_null($charset))
-        echo ' accept-charset="'.htmlspecialchars($charset).'"';
+        echo ' accept-charset="'.sm_encode_html_special_chars($charset).'"';
 
     echo ">\n";
 
@@ -928,7 +927,7 @@ function translate_form_google($message) {
          translate_lang_opt('en_US', 'ko_KR', 'en|ko',
                             sprintf( _("%s to %s"),_("English"),_("Korean"))) .
          translate_lang_opt('en_US', 'zh_CN', 'en|zh-CN',
-                            sprintf( _("%s to %s"),_("English"),_("Chinese (Simplified)"))) .
+                            sprintf( _("%s to %s"),_("English"),_("Chinese, Simplified"))) .
          translate_lang_opt('de_DE', 'en_US', 'de|en',
                             sprintf( _("%s to %s"),_("German"),_("English"))) .
          translate_lang_opt('de_DE', '', 'de|fr',
@@ -950,7 +949,7 @@ function translate_form_google($message) {
          translate_lang_opt('ko_KR', '', 'ko|en',
                             sprintf( _("%s to %s"),_("Korean"),_("English"))).
          translate_lang_opt('zh_CN', '', 'zh-CN|en',
-                            sprintf( _("%s to %s"),_("Chinese (Simplified)"),_("English")));
+                            sprintf( _("%s to %s"),_("Chinese, Simplified"),_("English")));
     echo '</select>'.
         '<input type="hidden" name="hl" value="en" />' .
         '<input type="hidden" name="ie" value="UTF8" />' .