style police
[squirrelmail.git] / functions / gettext.php
index 90da1db65fed1d77b44e95671c379131c8d64772..50ce7b251e84c50e0514164da78ff4f4b5bcc599 100644 (file)
@@ -1,18 +1,39 @@
 <?PHP
 
-   /* Alternate to the system's built-in gettext.
-    * relies on .po files (can't read .mo easily).
-    * Uses the session for caching (speed increase)
-    * Possible use in other PHP scripts?  The only SM-specific thing is
-    *   $sm_language, I think
-    *
-    * Very special thanks to Konstantin Riabitsev for letting me use a
-    * server that didn't already have gettext on it!
-    */
-   
-   global $gettext_php_domain, $gettext_php_dir, $gettext_php_loaded,
-      $gettext_php_translateStrings, $gettext_php_loaded_language,
-      $gettext_php_short_circuit;
+/**
+ * gettext.php
+ *
+ * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * Alternate to the system's built-in gettext.
+ * relies on .po files (can't read .mo easily).
+ * Uses the session for caching (speed increase)
+ * Possible use in other PHP scripts?  The only SM-specific thing is
+ *   $sm_language, I think
+ *
+ * $Id$
+ */
+
+/*****************************************************************/
+/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!!           ***/
+/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION.             ***/
+/***    + Base level indent should begin at left margin, as    ***/
+/***      the global definition below.                         ***/
+/***    + All identation should consist of four space blocks   ***/
+/***    + Tab characters are evil.                             ***/
+/***    + all comments should use "slash-star ... star-slash"  ***/
+/***      style -- no pound characters, no slash-slash style   ***/
+/***    + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD      ***/
+/***      ALWAYS USE { AND } CHARACTERS!!!                     ***/
+/***    + Please use ' instead of ", when possible. Note "     ***/
+/***      should always be used in _( ) function calls.        ***/
+/*** Thank you for your help making the SM code more readable. ***/
+/*****************************************************************/
+
+global $gettext_php_domain, $gettext_php_dir, $gettext_php_loaded,
+       $gettext_php_translateStrings, $gettext_php_loaded_language,
+       $gettext_php_short_circuit;
    
    if (! isset($gettext_php_loaded)) {
       $gettext_php_loaded = false;
            }
             $gettext_php_translateStrings[$key] =
                stripslashes($gettext_php_translateStrings[$key]);
+           // If there is no translation, just use the untranslated string
+           if ($gettext_php_translateStrings[$key] == '')
+              $gettext_php_translateStrings[$key] = $key;
            $key = '';
         }
       }