Just a quick question regarding to i18n()
Whats the matter with the double check of array_key_exists($name, $i18n) and unused global $LANG?
That could be:
Without including en_US.php theres no need for that right? (or im missing something?)
PHP Code:
function i18n($name, $echo=true) {
global $i18n;
global $LANG;
if(!isset($i18n)) return;
if (array_key_exists($name, $i18n)) {
$myVar = $i18n[$name];
} else {
# this messes with the global $i18n
//include_once(GSLANGPATH . 'en_US.php');
if (array_key_exists($name, $i18n)) {
$myVar = $i18n[$name];
} else {
$myVar = '{'.$name.'}';
}
}
if (!$echo) {
return $myVar;
} else {
echo $myVar;
}
}
Whats the matter with the double check of array_key_exists($name, $i18n) and unused global $LANG?
That could be:
PHP Code:
function i18n($name, $echo=true) {
global $i18n;
if(!isset($i18n)) return;
if (array_key_exists($name, $i18n)) {
$myVar = $i18n[$name];
} else {
$myVar = '{'.$name.'}';
}
if (!$echo) {
return $myVar;
} else {
echo $myVar;
}
}