I am basic programer in php. I want to use PO/MO file for build a multi language example in php But when I am calling gettext functions (__() or _e()) Stay in that function for ever. I Uses poedit GUI for edit .po files and configured poedit as shown in the below.
add "../../.." for source path
add "__" and "_e" for source keywords
and located .po/.mo files in htdocs/locale/en_EN/LC_MESSAGES/ path.
My PHP code shown in the below :
<html>
<body>
<h1>TRANSLATION : </h1>
<br>
<?php
$language = "en_EN";
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $language);
bindtextdomain("default", "./locale");
textdomain("default");
echo "str Hello ".__("Jhon");
?>
</body>
</html>
I am Also translated jhon to joe in poedit and validate it without any error but my example when runs in browser didn't show anything except my h1 string after debug I found php stay in __("jhon") function.
Also i read a Q&A in stackoverflow and rename my file from en_EN.po/en_EN.mo to default.po/default.mo but it's seem like pervious.