Re: gettext() troubles

From: Date: Fri, 23 Sep 2005 14:51:35 +0000
Subject: Re: gettext() troubles
References: 1  Groups: php.general php.i18n 
Request: Send a blank email to php-general+get-223070@lists.php.net to get a copy of this message
Denis Gerasimov wrote:
<?php putenv("LANG=ru_RU"); setlocale (LC_ALL,"ru"); $domain = 'messages'; echo bindtextdomain ($domain, 'D:\intranet\wwwroot\lng'); echo textdomain ($domain); echo bind_textdomain_codeset($domain, 'UTF-8'); echo gettext("string"); ?>
Here's what I use to set my language (to French in this case). It works 100% of the time for me: // Set locale to preferred language setlocale(LC_ALL, 'fr_FR'); bindtextdomain('messages', $_SERVER['DOCUMENT_ROOT'].'/locale'); textdomain('messages'); I don't do the "putenv" line that you have, so I'm not sure if it's necessary... -- Aaron Gould Programmer/Systems Administrator PARTS CANADA

« previous php.general (#223070) next »