1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-08-07 17:42:53 +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

@@ -51,6 +51,11 @@ require_once("$incpath/functions.inc.php");
$_SESSION['lang'] = $language = check_language (); # TODO: storing the language only at login instead of calling check_language() on every page would save some processor cycles ;-)
require_once("$incpath/languages/" . $_SESSION['lang'] . ".lang");
if($CONF['language_hook'] != '' && function_exists($CONF['language_hook'])) {
$hook_func = $CONF['language_hook'];
$PALANG = $hook_func ($PALANG, $_SESSION['lang']);
}
/**
* @param string $class
* __autoload implementation, for use with spl_autoload_register().