View previous topic :: View next topic |
Author |
Message |
wetter n00b
Joined: 13 Jan 2004 Posts: 26 Location: amsterdam
|
Posted: Tue Jun 24, 2008 6:22 am Post subject: Apache and locales (Apache PHP locale gettext) please help |
|
|
Hello everybody,
I have a strange problem running apache and php. date() amongst others gives me english month names where i need different ones set by setlocale().
I followed the Gentoo localization guide:
http://www.gentoo.org/doc/de/guide-localization.xml
http://www.gentoo.org/doc/en/guide-localization.xml
and this seems to work:
# locale -a
C
de_CH.utf8
de_DE
de_DE@euro
de_DE.iso88591
de_DE.iso885915@euro
de_DE.utf8
deutsch
en_US
en_US.iso88591
en_US.utf8
fr_CH.utf8
german
it_CH.utf8
POSIX
# locale
LANG=de_DE.utf8
LC_CTYPE="de_DE.utf8"
LC_NUMERIC="de_DE.utf8"
LC_TIME="de_DE.utf8"
LC_COLLATE="de_DE.utf8"
LC_MONETARY="de_DE.utf8"
LC_MESSAGES="de_DE.utf8"
LC_PAPER="de_DE.utf8"
LC_NAME="de_DE.utf8"
LC_ADDRESS="de_DE.utf8"
LC_TELEPHONE="de_DE.utf8"
LC_MEASUREMENT="de_DE.utf8"
LC_IDENTIFICATION="de_DE.utf8"
LC_ALL=de_DE.utf8
# date +%B
Juni
this is fine "Juni" is german for june.
But in Apache / PHP it is different:
there i have:
Available Locales
* C
* de_CH.utf8
* de_DE
* de_DE@euro
* de_DE.iso88591
* de_DE.iso885915@euro
* de_DE.utf8
* deutsch
* en_US
* en_US.iso88591
* en_US.utf8
* fr_CH.utf8
* german
* it_CH.utf8
* POSIX
Default PHP Locale
* LANG=de_DE.utf8
* LC_CTYPE="de_DE.utf8"
* LC_NUMERIC="de_DE.utf8"
* LC_TIME="de_DE.utf8"
* LC_COLLATE="de_DE.utf8"
* LC_MONETARY="de_DE.utf8"
* LC_MESSAGES="de_DE.utf8"
* LC_PAPER="de_DE.utf8"
* LC_NAME="de_DE.utf8"
* LC_ADDRESS="de_DE.utf8"
* LC_TELEPHONE="de_DE.utf8"
* LC_MEASUREMENT="de_DE.utf8"
* LC_IDENTIFICATION="de_DE.utf8"
* LC_ALL=de_DE.utf8
but
date('l F');
keeps outputting
"Tuesday June"
I have LINGUAS set in make.conf "de fr it en" also.
Please if anyone knows places on where to go on checking please share. |
|
Back to top |
|
|
TheAl Tux's lil' helper
Joined: 22 Jan 2004 Posts: 134
|
Posted: Tue Jun 24, 2008 9:51 am Post subject: |
|
|
Add a line in start of you php file :
Code: | setlocale(LC_ALL, 'de_DE'); |
http://ch2.php.net/set_locale |
|
Back to top |
|
|
wetter n00b
Joined: 13 Jan 2004 Posts: 26 Location: amsterdam
|
Posted: Tue Jun 24, 2008 1:26 pm Post subject: |
|
|
Hi TheAl,
thanks for your suggestion, unfortunately that is not solving my issue. When i put this:
Code: |
setlocale(LC_ALL,"de_DE");
$date=date('l F');
echo '<hr><h3>';
echo $date;
|
i get that:
how can that happen, i wonder...? |
|
Back to top |
|
|
|