The following are few ideas for storing text for a multilingual site.
a. One version of the site for each language. (not scaleable. hard to maintain.)
b. All text values in language tables in database (many database hits will slow things down)
c. All text values into arrays in seperate files. Include file according to language and get value from array. (hard to maintain....but works pretty well-this is what I'm doing now.)
d. Create xml file. Each node is value key, and value in each language. Use some php function to read value according to language from xml file.
I'm pretty much like the last one (xml file) as this will be the closest I can get to resource files in asp.net (one of the few things that's really cool about asp.net).
But I'm not sure what is the fastest, easiest best way to find specific values in xml files using php. Had a quick look at some sample code, and seems mostly one will loop through nodes? Is there some code that one can create to easily and quicly retrieve node values?
Other suggestions are welcome.
a. One version of the site for each language. (not scaleable. hard to maintain.)
b. All text values in language tables in database (many database hits will slow things down)
c. All text values into arrays in seperate files. Include file according to language and get value from array. (hard to maintain....but works pretty well-this is what I'm doing now.)
d. Create xml file. Each node is value key, and value in each language. Use some php function to read value according to language from xml file.
I'm pretty much like the last one (xml file) as this will be the closest I can get to resource files in asp.net (one of the few things that's really cool about asp.net).
But I'm not sure what is the fastest, easiest best way to find specific values in xml files using php. Had a quick look at some sample code, and seems mostly one will loop through nodes? Is there some code that one can create to easily and quicly retrieve node values?
Other suggestions are welcome.
Comment