Opened 14 years ago

Closed 14 years ago

#193 closed defect (fixed)

gettext problem under Windows

Reported by: etdube Owned by: etdube
Priority: major Milestone:
Component: other Version:
Keywords: gettext Cc:

Description

After migrating a project instance from PHP 5.2.x to 5.3.5, I noticed that all the labels retrieved by gettext weren't translated properly anymore (i.e. there were "i18n_..." labels all over the place). I haven't pinpointed the exact source of the problem, but we noticed the exact same behavior under another web app using PHP 5.3.x under a 64-bit version of Windows (whereas it worked correctly under a 32-bit OS ; however I haven't had a chance to test GeoPrisma using PHP 5.3.x under a 32-bit Windows OS).

While looking up the issue on the web, I came across many reports saying that gettext with PHP under Windows breaks easily. Yves M. suggested to try an alternate implementation, namely php-gettext (https://launchpad.net/php-gettext/). It accepts the same .po/.mo file format as GNU gettext, but is pure PHP and doesn't have any dependency on a C library. License is GPLv2.

I tested this lib by creating a new implementation of the Locale class, and it works perfectly under the same environment where the default gettext was failing. Should we replace the default Locale class by this one (and include the dependency in lib/ under the GeoPrisma distribution), or just make its use optional?

Attachments (1)

gp_php-gettext.patch (3.4 KB ) - added by etdube 14 years ago.
patch with php-gettext implementation of Locale

Download all attachments as: .zip

Change History (3)

comment:1 by etdube, 14 years ago

Component: documentationother
Keywords: gettext added
Owner: set to etdube
Status: newassigned

by etdube, 14 years ago

Attachment: gp_php-gettext.patch added

patch with php-gettext implementation of Locale

comment:2 by etdube, 14 years ago

Resolution: fixed
Status: assignedclosed

Fixed in rev 991 - GeoPrisma still uses GNU gettext as the default implementation, but a new PhpGetTextLocale class was added which supports php-gettext (distributed separately under a GPLv2 license)

Note: See TracTickets for help on using tickets.