Link to home
Start Free TrialLog in
Avatar of v46n
v46nFlag for Canada

asked on

PHP gettext on IIS 7.0

I am making a website that supports multiple languages. I am trying to use PHP's gettext to accomplish this.

Relevant code:
$locale = "fra_can";
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("messages", "./locale");
textdomain("messages");

The above code works perfectly on a Unix based host. However this site is on IIS 7.0. No matter what I do I can not seem to get it to work on Windows (Server 2008 or 7).

I've tried tons of different locales to no avail. (fr_CA, French_Canada.1252, fra_can, fra_fra, etc.)

Folder structure I have been using is "locale/fra_can/LC_MESSAGES/messages.mo" and "locale/fra_can/LC_MESSAGES/messages.po"

Any ideas would be appreciated. Thanks.
Avatar of Brad Howe
Brad Howe
Flag of Canada image

Hi,

How did you go about installing PHP? Did you use the Web Platform installer?
http://www.microsoft.com/web/gallery/install.aspx?appsxml=&appid=PHP%3bPHP%3bPHP


If not, under the Web Platform options, Select "Frameworks and Runtimes", Click customize and install PHP 5.2.13.

After going through this, try your code again.

Cheers,
Hades666
Avatar of v46n

ASKER

Yea I had tried that, no luck unfortuantely
ASKER CERTIFIED SOLUTION
Avatar of v46n
v46n
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial