FreeBSD locales



Hi,

I have problems implementing i18n on my site hosted on a FreeBSD
server, using PHP. While it was hosted on a Linux server, there were
no problems,
but once I transferred it to FreeBSD, gettext() doesn't translate
anything. Here's my directory structure:

public_html
|-- index.php
`-- locale
|-- en_US.ISO8859-1
| `-- LC_MESSAGES
| |-- OOModelProvider.mo
| `-- OOModelProvider.po
`-- sr_YU.ISO8859-2
`-- LC_MESSAGES
|-- OOModelProvider.mo
`-- OOModelProvider.po

And here's the function that calls php locale-related functions:
/* domain is "OOModelProvider", language is "en_US.ISO8859-2"
*/
function setLocale( $language, $domain )
{
@bindtextdomain( $domain, "/home/darko/public_html/
locale/" );
@bind_textdomain_codeset( $domain, "utf-8" );

if ( ! @setlocale( LC_MESSAGES, $language ) )
throw new Exception( "setlocale" );
textdomain( $domain );
}

This worked perfectly on Linux, but it doesn't work with FreeBSD. I
read somewhere that libintl needs to be installed for LC_MESSAGES, but
1. it is installed 2. LC_ALL instead of LC_MESSAGES doesn't work
neither.

Another important note: LC_DATE works, i.e. sprintf and strftime
(which are locale-aware) work as expected, that is, they print the
strings in expected languages.

Also, after I do setlocale(LC_MESSAGES, $language), I call it with "0"
as the second argument and it returns the correct locale set.

Please, if you have any ideas, post them here.

Thanks.

.



Relevant Pages

  • Re: FreeBSD locales
    ... I have problems implementing i18n on my site hosted on a FreeBSD ... While it was hosted on a Linux server, ... And here's the function that calls php locale-related functions: ... as the second argument and it returns the correct locale set. ...
    (comp.unix.programmer)
  • Freebsd locales (gettext)
    ... I have problems implementing i18n on my site hosted on a FreeBSD ... While it was hosted on a Linux server, there were no problems, ... Also, after I do setlocale(LC_MESSAGES, $language), I call it with "0" ... as the second argument and it returns the correct locale set. ...
    (comp.lang.php)
  • Re: FreeBSD locales
    ... I have problems implementing i18n on my site hosted on a FreeBSD ... While it was hosted on a Linux server, ... function setLocale($language, $domain) ... as the second argument and it returns the correct locale set. ...
    (comp.unix.programmer)
  • Re: What FreeBSD users really want
    ... dogged by turn of the century hassle with our FreeBSD. ... Fundamental thing like system installer is still phenomenally arcane. ... PHP is by far the most popular computing language in the world. ... have a shell called PHP shell. ...
    (freebsd-questions)
  • Re: PHP on FreeBSD - Compiler Bugs and Option selection
    ... Re: PHP on FreeBSD - Compiler Bugs and Option selection: ... >>I just wanted to check you had received OK the two compiler errors that I ...
    (freebsd-questions)