a_bertrand wrote:Why would too many query be harmful? However think that when you develop you will need to deploy both the data in the DB and your code. For me that's actually more annoying. Maybe you would be better served with a XML or other formatted text file?
Well that can be a pain in the butt yes, but there is need for DB on other stuff that is mandatory, and I'm planning on creating a install script that does all the database stuff in one go.
XML or even JSON would be a nice alternative, although the editing would be hard no? Like I imagine:
Code: Select all
<language>
<en>
<welcome>Welcome to Our site!</welcome>
</en>
<pt>
<welcome>Bemvindo </welcome>
</pt>
Hm, after I did this I kinda figured it out. I could load this xml/json into a proper xml/json object, then edit it out, then export it back again right?
Jackolantern wrote:I would probably suggest going with making a "resources" folder or something like that and having a string resources file in which you can set up your array or whatever data structure you want to house the different language strings.
I think there are also some PHP templating engines that can handle localization (also often called "l10n", which basically just means "L, 10 letters and then N") and it is also a feature in many MVC libraries.
I'm using CodeIgniter, but as you said it uses those "resource" files that are php... and I would have to allow the edit only inside the double quotes, and that seems like it's harder than a simple query no? :/