I have a .po and .mo file in a folder with the address / locale / nld_nld / LC_MESSAGES / . Both file names are messages. I tried to use the following code:
try.php:
<?php
require_once("Localization.php");
echo _("Hello World!");
?>
Localization of .php goes here:
<?php
$locale = "nld_nld";
if (isSet($_GET["locale"])) $locale = $_GET["locale"];
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("messages", "./locale");
bind_textdomain_codeset("messages", 'UTF-8');
textdomain("messages");
?>
try.php Localization . , xampp. phpinfo();. , "GetText Support", . messages.po messages.mo , poEdit. Windows. , try.php, Hello World! ( . , .po 100% ( poEdit). , . .
!