note 34967 added to ref.gettext
| From: | wouter at grep dot be | Date: | Wed, 13 Aug 2003 17:28:03 +0000 |
| Subject: | note 34967 added to ref.gettext | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-54090@lists.php.net to get a copy of this message | ||
Of course, translation is only interesting if you provide the user with the language and encoding he
asks for. Since there's part of the HTTP protocol that allows you to specify that, it's
nice if one can use that information to pick the 'right' translation out of the ones you
have available.
I wrote something that does just that -- it parses the 'Accept-Language' and
'Accept-Charset' HTTP/1.1 headers, and tells you which one the user prefers out of a list
you provide. You can download it at http://www.grep.be/articles/php-accept.php
Note that even if the user's browser may support this, the user may not know about it; as such,
it's probably good practice not to remove links to other-languaged versions, so that people can
still get a version of your site in another language if they so prefer.
----
Manual Page -- http://www.php.net/manual/en/ref.gettext.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34967
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34967&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34967&report=yes