Ok, stupid question, I guess...
I'm trying to do this:
File: pt.php
<?php $langlist = array ( "Car" => "Carro", "Big Car" => "Carro grande") ?>
File: index.php
<?php
$lang = 'pt';
if ($lang != 'en') include('locale/' . $lang . '.php');
function __($langstring){
if ($lang != 'en'){
echo $langlist[$langstring];
} else {
echo $langstring;
}
}
?>
But this doesn't work (Notice: Undefined variable: lang and langlist).
What am I doing wrong?
P.S.: I know using echo instead of return inside a function ins't correct, but I don't want do be using echo __(); every time I need to use this function...