Her yerde SO o gettext bunu yapmak için en iyi yol olduğunu söylemek PHP herkes bir çok dil uygulaması yapmaya gelince. Ben sadece neden bilmek isteyen ki?
Ne bu yöntem aşağıda yapar gibi, daha sonra gettext az verimli kullanıyor?
<?PHP
//Have seperate language files for each language I add, this would be english file
function lang($phrase){
static $lang = array(
'NO_PHOTO' => 'No photo\'s available',
'NEW_MEMBER' => 'This user is new'
);
return $lang[$phrase];
}
//Then in application where there is text from the site and not from users I would do something like this
echo lang('NO_PHOTO'); // No photo's available would show here
?>