1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-07-07 23:21:07 +03:00

config.inc.php:

- new config option $CONF['language_hook']
  Hook function to override or add translations to $PALANG.
  Example hook function included (commented out).

common.php:
- honor $CONF['language_hook']

scripts/postfixadmin-cli.php:
- honor $CONF['language_hook']
- add TODO - language shouldn't be hardcoded to english

This implements my feature request at
http://sourceforge.net/tracker/?func=detail&aid=3292408&group_id=191583&atid=937967


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1176 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
Christian Boltz
2011-08-23 21:23:16 +00:00
parent 1033c950fa
commit a5f3cb9b96
3 changed files with 41 additions and 1 deletions

View File

@ -215,7 +215,7 @@ class PostfixAdmin {
PATH.'/config.inc.php',
PATH.'/languages/language.php',
PATH.'/functions.inc.php',
PATH.'/languages/en.lang',
PATH.'/languages/en.lang', # TODO: honor $CONF[default_language] and/or language from $_ENV
CORE_INCLUDE_PATH.'/common.php',
CORE_INCLUDE_PATH.'/inflector.php',
);
@ -230,6 +230,12 @@ class PostfixAdmin {
Config::write($CONF);
Lang::getInstance();
if($CONF['language_hook'] != '' && function_exists($CONF['language_hook'])) {
$hook_func = $CONF['language_hook'];
$PALANG = $hook_func ($PALANG, 'en'); # $includes is also hardcoded to 'en' - see TODO above
}
Lang::write($PALANG);
return true;