[PHP] setlocale on OS X not working

2001-12-27 Thread Stefan Rusterholz

Hi

I'm using following code:

setlocale(LC_ALL, 'german');
$timestamp = time();
$string = strftime('Heute ist %A, der %d. %B %Y. Sie haben diese Seite 
um %H Uhr %M aufgerufen.', $timestamp); # in english: today it's %A, 
the %d. %B. %Y. You opened this page at %H:%M.

echo $string;

Which works nice on my ISP's Server. On my locale OS X Server it seems 
like it wouldn't be able to translate it. I get the correct output but 
in english instead of german. AFAIR I need to have some files to be 
installed on my system for that function to work correct. Does someone 
know where to get those files and where to put them in my system?

best regards
Stefan Rusterholz


-- 
PHP General 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]




Re: [PHP] setlocale on OS X not working

2001-12-27 Thread Brian Clark

* Stefan Rusterholz ([EMAIL PROTECTED]) [Dec 27. 2001 09:13]:

 Hi

Hiya

 I'm using following code:

 setlocale(LC_ALL, 'german');
 $timestamp = time();
 $string = strftime('Heute ist %A, der %d. %B %Y. Sie haben diese Seite 
 um %H Uhr %M aufgerufen.', $timestamp); # in english: today it's %A, 
 the %d. %B. %Y. You opened this page at %H:%M.
   
 echo $string;

 Which works nice on my ISP's Server. On my locale OS X Server it seems 
 like it wouldn't be able to translate it. I get the correct output but 
 in english instead of german. 

The OSX machine doesn't have a definition for `german' but it probably
has one for en_US, for example. Try de or de_DE or de_DE.ISO8859-1
instead of `german' and see if you get what you'd expect. FYI, I've
never used OSX, so I'm flying blind.

 AFAIR I need to have some files to be 
 installed on my system for that function to work correct. Does someone 
 know where to get those files and where to put them in my system?

On my system, charmaps in /usr/share/i18n/locales and definitions in
/usr/lib/locale, and I would use localedef to build definitions from the
charmaps (I think. I might have those directories reversed.).

I've never used (or seen) OSX, but does it use man? (I'm absolutely not
being a smarta$$ here). If it has man, look at the man pages for 
`localedef' and `locale' and that may get you headed in the right
direction.

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
The gene pool could use a little chlorine.


-- 
PHP General 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]




Re: [PHP] setlocale on OS X not working

2001-12-27 Thread Stefan Rusterholz

Thanks for your help, but it doesn't work either :-(

Am Donnerstag den, 27. Dezember 2001, um 16:12, schrieb Brian Clark:

 * Stefan Rusterholz ([EMAIL PROTECTED]) [Dec 27. 2001 09:13]:

 Hi

 Hiya

 I'm using following code:

 setlocale(LC_ALL, 'german');
 $timestamp = time();
 $string = strftime('Heute ist %A, der %d. %B %Y. Sie haben diese Seite
 um %H Uhr %M aufgerufen.', $timestamp); # in english: today it's %A,
 the %d. %B. %Y. You opened this page at %H:%M.
  
 echo $string;

 Which works nice on my ISP's Server. On my locale OS X Server it seems
 like it wouldn't be able to translate it. I get the correct output but
 in english instead of german.

 The OSX machine doesn't have a definition for `german' but it probably
 has one for en_US, for example. Try de or de_DE or de_DE.ISO8859-1
 instead of `german' and see if you get what you'd expect. FYI, I've
 never used OSX, so I'm flying blind.

 AFAIR I need to have some files to be
 installed on my system for that function to work correct. Does someone
 know where to get those files and where to put them in my system?

 On my system, charmaps in /usr/share/i18n/locales and definitions in
 /usr/lib/locale, and I would use localedef to build definitions from the
 charmaps (I think. I might have those directories reversed.).

 I've never used (or seen) OSX, but does it use man? (I'm absolutely not
 being a smarta$$ here). If it has man, look at the man pages for
 `localedef' and `locale' and that may get you headed in the right
 direction.


I did that. For localedef it hasn't an entry. But for locale it has one. 
I don't think that's what you expectet (it seems to belong to perl)

locale(3)Perl Programmers Reference Guide   locale(3)

NAME
locale - Perl pragma to use and avoid POSIX locales for
built-in operations

SYNOPSIS
@x = sort @y;   # ASCII sorting order
{
use locale;
@x = sort @y;   # Locale-defined sorting order
}
@x = sort @y;   # ASCII sorting order again

DESCRIPTION
This pragma tells the compiler to enable (or disable) the
use of POSIX locales for built-in operations (LC_CTYPE for
regular expressions, and LC_COLLATE for string compari-
son).  Each use locale or no locale affects statements
to the end of the enclosing BLOCK.

See the perllocale manpage for more detailed information
on how Perl supports locales.

2000-03-30 perl v5.6.0

Perhaps this information helps you to help me further:
Mac OS X is based on FreeBSD 3.0 (AFAIR).



Re: [PHP] setlocale on OS X not working

2001-12-27 Thread Brian Clark

* Stefan Rusterholz ([EMAIL PROTECTED]) [Dec 27. 2001 11:30]:

 I did that. For localedef it hasn't an entry. But for locale it has one. 
 I don't think that's what you expectet (it seems to belong to perl)

Then you need to find out how to `compile' locale definitions for your
system.

 locale(3)Perl Programmers Reference Guide   locale(3)

Oh no no. g 

   man 1 locale

Does that give you anything? (I'm guessing it would have picked that up
first if it existed).

(~)% man locale | head
Reformatting locale(1), please wait...
LOCALE(1)Debian GNU/Linux   LOCALE(1)

NAME
   locale - Get locale-specific information.

SYNOPSIS
   locale [ -a | -m]


That's the one I was talking about..

Is there a `locale' package you can install for OSX? (There is for my 
system.) 

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Every morning is the dawn of a new error.


-- 
PHP General 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]




Re: [PHP] setlocale on OS X not working

2001-12-27 Thread Stefan Rusterholz

I forgot to mail that to the mailinglist too...

 * Stefan Rusterholz ([EMAIL PROTECTED]) [Dec 27. 2001 11:30]:

 I did that. For localedef it hasn't an entry. But for locale it has 
 one.
 I don't think that's what you expectet (it seems to belong to perl)

 Then you need to find out how to `compile' locale definitions for your
 system.

 locale(3)Perl Programmers Reference Guide   locale(3)

 Oh no no. g

man 1 locale

 Does that give you anything? (I'm guessing it would have picked that up
 first if it existed).

 No, it doesn't :-(
 and locale produces locale: Command not found

 That's the one I was talking about..

 Is there a `locale' package you can install for OSX? (There is for my
 system.)
 There is one, but not for PHP, only for the system (which is actually 
 multilingual and able to change language during runtime)

 Thank you for your help although...

 best regards
 Stefan Rusterholz



-- 
PHP General 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]




Re: [PHP] setlocale on OS X not working

2001-12-27 Thread Stefan Rusterholz

Hm, as far as I see that package is for Aqua (the GUI of OS X) and not 
for the core (FreeBSD, *nix), so it won't help - and it is actually 
installed (I use OS X in a german enviroment because I'm swiss).

Do you know where to get language packets for FreeBSD? That might work...

Am Donnerstag den, 27. Dezember 2001, um 18:36, schrieb Brian Clark:

 * Stefan Rusterholz ([EMAIL PROTECTED]) [Dec 27. 2001 12:12]:

 Is there a `locale' package you can install for OSX? (There is for my
 system.)
 There is one, but not for PHP, only for the system (which is actually
 multilingual and able to change language during runtime)

 That's what I'm talking about -- for the system.

 --
 Brian Clark | Avoiding the general public since 1805!
 Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
 HTML email needs a rant tag.



-- 
PHP General 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]




Re: [PHP] setlocale on OS X not working

2001-12-27 Thread Brian Clark

* Stefan Rusterholz ([EMAIL PROTECTED]) [Dec 27. 2001 13:11]:

 Hm, as far as I see that package is for Aqua (the GUI of OS X) and not 
 for the core (FreeBSD, *nix), so it won't help - and it is actually 
 installed (I use OS X in a german enviroment because I'm swiss).

I can't help you there. Although FreeBSD may use another method, or they
may already be in the system, I'd just have no idea where you should
look. 

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
English is my second language, gibberish is my first.


-- 
PHP General 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]