Okay, here is what I've done:

I have a file /www/test.php:

    <?
    header('Content-Type: text/plain; charset=ISO-8859-1');
    putenv('LANG=en');
    putenv('LANGUAGE=en');
    setlocale(LC_ALL, '');
    bindtextdomain("messages", "/usr/local/easydns/locale");
    textdomain("messages");

    echo _("Hello world.");
    ?>

I then do:

    xgettext --keyword=_ -C /www/test.php

This makes "messages.po" which looks like:

    # SOME DESCRIPTIVE TITLE.
    # Copyright (C) YEAR Free Software Foundation, Inc.
    # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
    #
    #, fuzzy
    msgid ""
    msgstr ""
    "Project-Id-Version: PACKAGE VERSION\n"
    "POT-Creation-Date: 2001-08-01 17:13-0400\n"
    "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    "Language-Team: LANGUAGE <[EMAIL PROTECTED]>\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=CHARSET\n"
    "Content-Transfer-Encoding: 8bit\n"

    #: /www/test.php:9
    msgid "Hello world."
    msgstr ""

I then do:

    mkdir /usr/local/easydns/locale/fr
    mkdir /usr/local/easydns/locale/fr/LC_MESSAGES
    cp messages.po /usr/local/easydns/locale/fr/LC_MESSAGES

I then edit that messages.po so it reads:

    msgid "Hello world."
    msgstr "Bonjour monde."

Then:

    msgfmt /usr/local/easydns/locale/fr/LC_MESSAGES/messages.po \
        -o /usr/local/easydns/locale/fr/LC_MESSAGES/messages.mo

I then check the test.php file in a browser: it's in english.

I edit test.php to read:

    <?
    header('Content-Type: text/plain; charset=ISO-8859-1');
    putenv('LANG=fr');
    putenv('LANGUAGE=fr');
    setlocale(LC_ALL, '');
    bindtextdomain("messages", "/usr/local/easydns/locale");
    textdomain("messages");

    echo _("Hello world.");
    ?>

Reload in a browser, and it's still english.  What am I missing?!?!

- Colin



-- 
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to