[nycphp-talk] multilingual strategies
Adam Maccabee Trachtenberg
adam at trachtenberg.com
Wed Dec 3 21:35:21 EST 2003
On Wed, 3 Dec 2003, Chris Snyder wrote:
> Marc Antony Vose wrote:
>
> > How do you handle multilingual sites? Do you tend to store data in
> > text files, in a database, or some other way? Do you maintain
> > different entire databases for each language, or different tables in
> > the same database, or just different columns in the same table(s)?
Some of the techniques I used to use are documented here:
http://www.onlamp.com/pub/a/php/2002/11/28/php_i18n.html
I don't think this meshes well with your setup, but I pass it along anyway.
> One suggestion: consider using valid locales as your language codes so
> that you can use them with strftime() to format dates. Just using "en"
> or "es" might not be enough depending on your OS.
You should definitely use locales. People are really picky about
this.
I would also suggest that you look into the GNU gettext library. You
can build it as a PHP extension and I would guess that gettext is very
efficient, if this is major concern to you.
It also allows you to handle all sorts of pluralization and other
oddities without needing to write your own.
-adam
PS: Oblig. PHP Cookbook Reference: Chapter 16.
--
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!
More information about the talk
mailing list