0
我想創建一個新的多語言網站。我用poEDit
和getText()
函數。我不知道我用這段代碼遺漏了什麼:多語言網站poEDit和getText()
<?php
if (!function_exists("gettext"))
{
echo "gettext is not installed\n";
} else {
echo "gettext is supported\n";
}
$language = 'ar_JO';
putenv("LANG=$language");
setlocale(LC_ALL, $language);
$domain = 'ar_JO';
bindtextdomain($domain, "./locale");
bind_textdomain_codeset($domain, 'UTF-8');
textdomain($domain);
echo _("HELLO_WORLD");
echo _("hi this to be translated ");
我有這個 「C:\ WAMP \ WWW \ loginSystemOOP /區域/ ar_JO/LC_MESSAGES/messages_ar_JO.mo」 我的文件結構是'C:\ wamp \ www \ loginSystemOOP/locale/ar_JO/LC_MESSAGES /' –