For multilanguation, I often use such a flagment of php code in my modules like this:
if( function_exists('easiestml') ) {
$mail_body = easiestml( $mail_body ) ;
}
<?php
function easiestml( $s , $lang = '' )
{
global $cubeUtilMlang ;
if( is_object( @$cubeUtilMlang ) ) {
if( $lang ) {
$orig_lang = $cubeUtilMlang->mLanguage ;
$cubeUtilMlang->mLanguage = $lang ;
$ret = $cubeUtilMlang->obFilter( $s ) ;
$cubeUtilMlang->mLanguage = $orig_lang ;
return $ret ;
} else {
return $cubeUtilMlang->obFilter( $s ) ;
}
} else {
return $s ;
}
}
nobunobu wrotes:
同じような関数定義を、小生のとあるサイトでは、
直接、MultiLanguagePreLoad.class.php内に追加定義してたりしてました