I am trying to use the gettext PHP extension to translate some lines. All functions return the correct values, but the gettext()
/ _()
call returns only the original string. The PO / MO files seem to be correct, and I believe that I configured the directories correctly. I am running WAMP Server with PHP 5.3.10 on Windows (also tried to work with 5.3.4 and 5.3.8 because I have installations).
First, see /new2/www/index.php
:
$locale = 'esn';
I created the following file structure:
www/new2/www/locale/Spanish_Spain.1252/LC_MESSAGES/messages.mo
I also tried replacing Spanish_Spain.1252
with: es_ES
, esn
, esp
, Spanish
and Spanish_Spain
.
The PO file used to generate the MO is similar (corresponding entry only):
#: C:\wamp\www\new2/www/index.php:76 msgid "In the dashboard" msgstr "TRANSLATED es_ES DASHBOARD"
This was generated using PoEdit. I restarted Apache after adding a new .MO file. Also note that I previously used Zend_Translate with Gettext, and it translated correctly. I want to rely on my own gettext extension, though, in part because I'm trying to create a lightweight structure of my own.
Any help would be appreciated.
Edit: Changed directory structure. Note. You can try the latest answers within 24 hours.
source share