|
Posted by Curt Zirzow on 12/29/05 07:24
On Wed, Dec 28, 2005 at 09:43:19PM -0600, Dan Jallits wrote:
> I want to be able to determine the browser language and
> redirect to the correct web folder. However, I want this folder to be
> symbolic, since I do not want multiple copies of the same information.
> Then the next step would be to pass the browser language to a service
> like Google Translate!
The first thing to look at is the var:
$_SERVER['HTTP_ACCEPT_LANGUAGE']
HTTP_ACCEPT_CHARSET, might come in handy as well pending the
lanuage.
I would read the specs on how these vars should be used.
Second, i would take a look at the gettext extension in php
http://php.net/gettext
This allows you to build a language dictionary for what ever
language you want to support. and you have one code base that just
looks like:
setlocale(LC_ALL', 'de_DE');
bindtext('myappname', '/path/to/dictionary');
textdomain('myappname');
echo _('This string will get translated if there is a german
dictionary of this string');
Curt.
--
cat .signature: No such file or directory
Navigation:
[Reply to this message]
|