Re: language translations on php site
| From: | Richard Baskett | Date: | Wed, 05 Mar 2003 21:21:01 +0000 |
| Subject: | Re: language translations on php site | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138364@lists.php.net to get a copy of this message | ||
Take a look at: http://www.php.net/manual/en/reserved.variables.php
and
scroll down to the HTTP_ACCEPT_LANGUAGE constant.
When you set your language variable within your browser, the
HTTP_ACCEPT_LANGUAGE constant can be accessed by
$_SERVER['HTTP_ACCEPT_LANGUAGE']. It results in a two letter code,
(usually).
The way that I do it, is grab the variable and just take the first two
letters of the variable and do my language support according to that.
Cheers!
Rick
"As I grow to understand life less and less, I learn to live it more and
more." - Jules Renard
> From: "electroteque" <daniel@electroteque.org>
> Date: Thu, 6 Mar 2003 07:46:37 +1100
> To: php-general@lists.php.net
> Subject: [PHP] language translations on php site
>
> Set your own language preference
> [01-Mar-2003] Starting from today, your browser's "Accept Language" setting
> is also honored on language sensitive pages on the php.net site. If you
> would like to get to the documentation page of echo for example, you can use
> the /echo shortcut on all mirror sites, if your browser is set to provide
> your language preference information to the server. This also makes the PHP
> error message links point to the documentation in your preferred language.
>
> You can set your preferences under Edit/Preferences/Navigator/Languages in
> Mozilla, and under Tools/Internet Options/Languages in Internet Explorer.
> This will probably also enhance your web experience on sites providing
> translated content.
>
>
>
> i'm interested how this works , any ideas ?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>