You are here: Re: [PHP] gettext() troubles « PHP « IT news, forums, messages
Re: [PHP] gettext() troubles

Posted by Aaron Gould on 10/04/95 11:27

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация