|
From: James E. F. <jf...@ac...> - 2002-05-15 16:48:39
|
A better solution would be to load the gettext.dll
extension in your php.ini (if you have it). Otherwise:
On Wed, 15 May 2002, Joe Leary wrote:
> //if(!ini_get('safe_mode') &&
> // (extension_loaded('gettext') || dl('gettext.so'))) {
> // if(!empty($HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'])) {
> // $langs = split(" *, *", $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE']);
> // foreach($langs as $lang) {
> // $lang = quotemeta($lang);
> // if(file_exists("$locale_path/$lang")) {
> // break;
> // }
> // }
> // }
> putenv("LC_ALL=$lang");
> bindtextdomain('messages', $locale_path);
> textdomain('messages');
> //} else if(!defined('_GETTEXT')) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
if (!defined('_GETTEXT')) {
> define('_GETTEXT',TRUE);
>
> function _($s) {return($s);}
> function bindtextdomain($s) {}
> function textdomain($s) {}
>
> //}
^^^^^^^^^^^^^^^
}
I hope that is clear, but I don't feel like reformatting
all that code above. :-)
-James
|