Ok, Let go right to the code,
PHP Code:
$locale = "Dutch_Netherlands.1252";
echo PHP_VERSION . "<br />";
echo (putenv("LC_ALL=$locale") ? "Success" : "Failure"). "<br />";
echo setlocale(LC_ALL, $locale) . "<br />";
echo bindtextdomain("messages", "C:\\Hello") . "<br />";
echo textdomain("messages") . "<br />";
echo gettext("Hello") . "<br />";
Directory structure is:
C:\Hello\Dutch_Netherlands.1252\LC_MESSAGES\messages.mo
C:\Hello\Dutch_Netherlands.1252\LC_MESSAGES\messages.po
messages.po contents:
msgid ""
msgstr ""
"Project-Id-Version: messages
"
"POT-Creation-Date: 2014-12-14 13:27+0330
"
"PO-Revision-Date: 2014-12-14 15:41+0330
"
"Last-Translator: xxxxxxxxxxxx
"
"Language-Team:
"
"Language: nl_NL
"
"MIME-Version: 1.0
"
"Content-Type: text/plain; charset=windows-1252
"
"Content-Transfer-Encoding: 8bit
"
"X-Generator: Poedit 1.7.1
"
"X-Poedit-Basepath: .
"
"Plural-Forms: nplurals=2; plural=(n != 1);
"
#: ..\..\..\xxxxxx:531
msgid "Hello"
msgstr "LOADED"
Output:
5.5.12
Success
Dutch_Netherlands.1252
C:\Hello
messages
Hello
Process Monitor results:
httpd.exe QueryDirectory C:\Hello SUCCESS
httpd.exe CreateFile C:\Hello\en_US\LC_MESSAGES\messages.mo PATH NOT FOUND: Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a
httpd.exe CreateFile C:\Hello\en\LC_MESSAGES\messages.mo PATH NOT FOUND: Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a
I cant see any reason for the above code to not work. So here I am to ask you if you see anything I dont. Everything goes smooth and yet Apache wants to read the English version.
Windows 7 SP1 x64