note 30442 added to function.gettext

From: Date: Tue, 18 Mar 2003 15:12:46 +0000
Subject: note 30442 added to function.gettext
Groups: php.notes 
Request: Send a blank email to php-notes+get-45462@lists.php.net to get a copy of this message
After many hours of tests/debug I found this behaviour in Red Hat 7.3 (I don't test with other versions/distros) The i18n settings doesn't work if not exits the right country code under /usr/lib/locale/. On my original instalation I just haved /usr/lib/locale/en* files, so after reinstall the glibc-common package the example showed here it works !. * To force reinstall of the package rpm -i --force glibc-common-2.2.5-34.i386.rpm * The working example $HOME/i18n.php ----begin---- #!/usr/bin/php <?php // Current locale settings echo "Current i18n:".setlocale(LC_ALL, 0)."\n\n"; // i18n support information here $language = 'es_ES'; $newLocale=setlocale (LC_ALL, $language); echo "After i18n:$newLocale\n\n"; // Set the text domain as 'messages' $domain = 'messages'; bindtextdomain($domain, "./locale"); textdomain($domain); echo gettext("The string must be here\n"); ?> ----end---- * My $HOME/locale/es_ES/LC_MESSAGES/messages.po ----begin---- # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2003-03-18 10:52+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: i18n.php:16 msgid "The string must be here\n" msgstr "La cadena debe ir aquí\n" ----end---- I hope this helps to you Thanks Hardy Beltran Monasterios -- http://www.php.net/manual/en/function.gettext.php http://master.php.net/manage/user-notes.php?action=edit+30442 http://master.php.net/manage/user-notes.php?action=delete+30442 http://master.php.net/manage/user-notes.php?action=reject+30442

« previous php.notes (#45462) next »