i18n
authorPierre Habouzit <madcoder@debian.org>
Wed, 10 Sep 2003 15:41:08 +0000 (15:41 +0000)
committerPierre Habouzit <madcoder@debian.org>
Wed, 10 Sep 2003 15:41:08 +0000 (15:41 +0000)
philter/philter/include/philter.inc.php
philter/philter/locales/philter.en.inc.php [new file with mode: 0644]

index ca0b2a8..8874dcd 100644 (file)
@@ -9,6 +9,8 @@
 
 require_once("include/core.inc.php");
 
+function i18n($_index) { global $philter; echo $philter->i18n($_index); }
+
 /** Philter base configuration class
  * This is the base class of Philter.
  */
@@ -38,8 +40,8 @@ class Philter {
      * @returns the string or false
      */
     function i18n($_index) {
-        if(isset($this->confg[$_index]))
-            return $this->confg[$_index];
+        if(isset($this->config['i18n'][$_index]))
+            return $this->config['i18n'][$_index];
         return false;
     }
 
diff --git a/philter/philter/locales/philter.en.inc.php b/philter/philter/locales/philter.en.inc.php
new file mode 100644 (file)
index 0000000..b5ad432
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/********************************************************************************
+* include/core.inc.php : The include file for using Philter Core
+* --------------------
+*
+* This file is part of the philter distribution
+* Copyright: See COPYING files that comes with this distribution
+********************************************************************************/
+
+$philter->config['i18n'] = Array(
+// index.php
+    'up' => 'Up',
+    'dn' => 'Down',
+    'del' => 'Delete',
+    'submit' => 'Submit',
+
+    'new_action' => 'New Action',
+    'new_match' => 'New Match',
+        
+    'global_title' => 'Global configuration',
+
+    'pool_title' => 'Redirection addresses Pool',
+    
+    'filter_title' => 'Individuals Rules',
+    'filter_list_title' => 'Filter List',
+    'new_rule' => '[ new rule ]',
+    
+    'filter_rule_conf' => 'Global Options',
+    'all_matches' => 'each match must be true',
+    'one_match' => 'only one match need to be true',
+    'blocking_rule' => 'stop after this rule if matched',
+    
+    'filter_matches_list' => 'Matches List',
+    'filter_actions_list' => 'Actions List',
+
+// include/email.php
+    'your_email' => 'your email ...',
+    'email' => 'Email',
+    'active' => 'Active',
+    'apply_changes' => 'Apply Changes',
+    'add' => 'Add'
+);
+
+$handle = opendir('locales/plugins');
+while(($file = readdir($handle)) !== false)
+    if(preg_match("/^.*\.en\.inc\.php$/",$file))
+        require_once('include/plugins/'.$file);
+closedir($handle);
+
+// PHP 4.3.0 required !!!
+// foreach(glob("include/plugins/*.en.inc.php") as $file) require_once($file);
+
+
+/********************************************************************************
+* $Id$
+* vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 textwidth=100:
+********************************************************************************/
+?>