D3モジュールの言語処理ですが、基本的にはファイルベースのオーバーライドシステムを採用しています。
ただ、同じモジュールが複数読み込まれる可能性がある以上、言語定数の多重定義という問題が生じます。ここで大事なのは、言語定数ファイルには、複数回読み込まれる可能性があるものとそうでないものの2種類ある、ということです。
例えば、modinfo.php は、モジュールインストーラなどで、同じ型のモジュールインスタンスとして複数回呼ばれます。ですから、XOOPS_TRUST_PATH/modules/(trustdirname)/language/(lang)/modinfo.phpはこのような構造になります。
$constpref = '_MI_' . strtoupper( $mydirname ) ;
if( ! defined( $constpref.'_LOADED' ) ) {
// a flag for this language file has already been read or not.
define( $constpref.'_LOADED' , 1 ) ;
define($constpref."_NAME","(name of the module)");
define($constpref."_DESC","(desc of the module)");
}
$modversion['name'] = constant($constpref.'_NAME') ;
$modversion['description'] = constant($constpref.'_DESC') ;
define('_MD_D3FORUM_ON','On');
define('_MD_A_D3FORUM_LABEL_SELECTFORUM','Select Forum');