Re: List of I18N implementation
| From: | Hironori Neal Sato | Date: | Thu, 22 Jun 2000 18:53:23 +0000 |
| Subject: | Re: List of I18N implementation | ||
| References: | 1 2 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-22@lists.php.net to get a copy of this message | ||
On Mon, Jun 19, 2000 at 04:53:38PM -0700, Carl W. Brown wrote:
>I left out the line/word break logic as well as the bidi logic because they
>deal with presentation issues when are more often handled the browser.
That's true, but you can not assume output from PHP goes to just browser.
I would like to have line/word break logic for sending out email. My
current solution is to write simple perl script to wrap email text.
(it works, but I would like to avoid firing up a perl process)
>Speaking of browsers we have another issue - browser HTTP headers.
>
>IDEA:
>
>Check browser language preferences. Charaset preferences(some browsers do
>not provide this).
>Check list of languages server supports.
>Check URL
>Optional charset detection
>Redirect if needed
>Rebuild input (browser headers)
This, again, my philosophy is this: "ignore whatever browser tells ya."
You can't trust browser's Javascript to avoid empty fields in input form,
nor assume the user has correct language preference set, etc, etc.
I have been bitten by crippled browsers by trusting them to work properly.
Above idea is to inteligently pick proper language/locale for PHP, correct?
When a user requests a particular URL, isn't it safe to asssume that
user is requesting particular locale website? Thus, above checking is
really not required by PHP.
For an example, say you have a site http://www.abcd.com/. When
someone
requests that URL, we don't know if user wants English version or
Japanese version. Sure, we can check language preference, then send
a location header like Location: http://www.abcd.com/ja/ for
redirection.
If one requests an URL with /ja/ directly, we can setup the web server
to configure PHP's locale even before PHP script gets executed.
At any rate, I feel all of above detection methods should stay out
of PHP's scope, and leave the task up to web server or any other
front end modules. Oh, encoding detection of post/get data should
belong to PHP though, but not others.
Hiro
--
Hironori Neal Sato <satoh@yyplanet.com>
Japanese Network - http://www.jpnnet.com/