#95 Provide a hook to override or add translations

closed-fixed
nobody
None
5
2011-08-23
2011-04-24
No

Sometimes people need to override (or add) translations.
Currently this is only possible by editing languages/*, which is a maintenance hell on upgrades.

We should offer a $CONF option to call a PHP function after languages/* to allow overriding translations.
The selected language should be provided as parameter.

Skeleton for the hook function:

function lang_override($LANG, $language) {
if ($language == "de") {
$LANG['whatever'] = 'foo';
}
return $LANG;
}

I chose to hand over $LANG as parameter instead of using "global $LANG" because it avoids global variables, which might be a good idea on our way to move everything in classes ;-)

Discussion

  • Christian Boltz

    Christian Boltz - 2011-08-23
    • status: open --> closed-fixed
     
  • Christian Boltz

    Christian Boltz - 2011-08-23

    Commited to SVN trunk r1176.

    See $CONF['language_hook'] and the example hook function in config.inc.php.

     

Log in to post a comment.