php3-list | 199908

Re: [PHP3] Interntionalisation From: Manuel Lemos (mlemos <email protected>)
Date: 08/30/99

Hello,

On 31-Aug-99 02:01:33, you wrote:

>I have a question about the internationalization capabilities of PHP. I
>cannot seem to find much information in the user manual.

Well, that depends on what exactly are you expecting from it. If you mean
having the text of your applications adapted to multiple applications, that
is more a application specific issue than a PHP issue.

Unlike desktop applications, Web applications should adapt to the locale
settings of the of the user computer that accesses them remotely rather
than the computer on which the server is running.

Certain PHP functions like strtoupper/strtolower are implicitly dependent
on the locale settings of the server. You would have to set server locale
environment variable to the user locale to make them work appropriately.

Even if you do so, that is not guarateed to work because the server machine
library that PHP was compiled with may not support the locale you need to
serve the user.

Because of that I have written a PHP class that that does generic string
mapping. With some programmer defined mapping tables you can do any sort
of case mapping.

I am providing that class in the address below with some tables to convert
the case ans strip accents and cedillas of ISO-Latin-1 characters, so it
may be used to convert çÉdîllÃs to çédîllãs or ÇÉDÍLLÃS or cEdillas. You
may use this class to do other types of string mapping.

http://phpclasses.UpperDesign.com/browse.html?package=8

Other than that I just use external PHP files to define locale definitions
arrays with mappings of all the strings that I need in my localized
applications. I usually have one locale definition file per page of my
applications.

Once I read that someone was willing to add GNU gettext support to PHP but
I don't know what happened about it.

To determine the idiom to use I usually ask the user to select one of the
available explicitely. You may allow try to determine that in advance by
looking into the HTTP request Accept headers or even check a knowledge base
to map the top level domain of the REMOTE_USER host address into default
idioms, but some times you are not able to determine the user host domain,
just the IP address.

>Also, we are thinking about compiling Solaris' icov library into PHP. Has
>anybody out there done this before. Pointers would be great.

I have never heard of that. What is it?

Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: email protected>?subject=Re:%20[PHP3]%20Interntionalisation&replyto=2637.912T764T753685mlemos <email protected>">mlemos <email protected>">http://phpclasses.UpperDesign.com/?user=mlemos <email protected>

--
E-mail: mlemos <email protected>
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--

-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>