>i'm looking here for some help with the design of a multilingual website. >Everything in that website needs to change from a language to an other. > >I've made search on the web to find some examples but i couldn't find very >interesting things about how to manage that, using php. >What's best ? >- Use a database and make a querry for each text i have to put on my pages? >- Use an xml file for each language and parse it to get my text? >- Use a .php file with a variable for each item i have on my website?
Are you using Apache, and are you serving up languages based on the user's language browser settings? Note that Apache gives you some flexibility with selecting files based on language preferences: http://httpd.apache.org/docs/mod/mod_mime.html#multipleext http://httpd.apache.org/docs/mod/mod_negotiation.html That may be helpful, though it depends on the specifics of your code. A typical way to deal with this is to separate out the variable pieces of text into some other file/location, and include one or another language setting files depending on preference. This is analogous to the old Mac filesystem's resource forks. How you actually implement this (xml, DB, php variables) depends on what you're doing elsewhere, and how you plan to maintain it. My inclination would be to just use the DB, have linked tables with languages and pieces of text in various languages. A single query could get a full language preference setting for a site, and a little array munging could turn it into a usable set of key/value pairs, where the key is the context of the text, and the value if the text itself. (Been thinking about this alot, since I'm being asked to develop a hybrid flash/html site that needs to be in Spanish and English) --------------------------------------------------------------------- michal migurski- contact info and pgp key: sf/ca http://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php