i18n
[old-projects.git] / philter / philter / include / philter.inc.php
index ab5cbc4..0196f66 100644 (file)
@@ -9,6 +9,9 @@
 
 require_once("include/core.inc.php");
 
+function i18n($_index) { global $philter; echo $philter->i18n($_index); }
+function _i18n($_index) { global $philter; return $philter->i18n($_index); }
+
 /** Philter base configuration class
  * This is the base class of Philter.
  */
@@ -27,8 +30,20 @@ class Philter {
             'path'    => array('procmail', 'spool'),
             'match_plugins' => array(),
             'action_plugins' => array(),
-            'global_plugin' => array()
+            'global_plugin' => array(),
+            'i18n' => array()
         );
+        $this->err = "";
+    }
+
+    /** returns the i18n string
+     * @param   $_index   the index of the string
+     * @returns the string or false
+     */
+    function i18n($_index) {
+        if(isset($this->config['i18n'][$_index]))
+            return $this->config['i18n'][$_index];
+        return false;
     }
 
     /** returns the error.