From: Pierre Habouzit Date: Wed, 10 Sep 2003 15:41:08 +0000 (+0000) Subject: i18n X-Git-Tag: procmail~49 X-Git-Url: http://git.polytechnique.org/?p=old-projects.git;a=commitdiff_plain;h=d821a8ac1e53741f9342a8c3b60acf91d7b85404 i18n --- diff --git a/philter/philter/include/philter.inc.php b/philter/philter/include/philter.inc.php index ca0b2a8..8874dcd 100644 --- a/philter/philter/include/philter.inc.php +++ b/philter/philter/include/philter.inc.php @@ -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 index 0000000..b5ad432 --- /dev/null +++ b/philter/philter/locales/philter.en.inc.php @@ -0,0 +1,58 @@ +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: +********************************************************************************/ +?>