views:

56

answers:

2

I'm working on php, mysql on a project

I'm planning to add a multilanguage option, usually I use single textfile for each php file, but I want to know if one of the followings is good or not and why.

  • Using one single textfile for the whole site: This would make my life peacefully because I have to make changes in one place only, but I don't know how scalable this option would be.
  • Using xml files for each php, is this scalable for dictionaries?
  • Using one single xml file, is this scalable for dictionaries?
  • Using a table in the db, I used this options a few times, but I read that it make the webpage slower and is not really scalable

That are my options, if any have a better one I would be greatfully, and if anyone have an advice on the pseudocode (I usually use a big array) and a replacement Welcome too :D

A: 

I only use db when I need other people to add / modify datas in my translation.

Else I use a php file by language, defining my variables in each.

Kaaviar
had you tried using single file or you use multiple files? had you tried using xml? I never tried, but I don't want to try it out and then find out I cant scale up, or I get a really slow page
Saikios
+1  A: 

use gettext
wordpress is a good example if you need one

as for your question, separate language files is the only solution, letting many people work on different languages separately

Col. Shrapnel
by single file I didn't mean one file for all the language, I meant one file for each language, but for example if I have 200 php files I will have only dictonary.en dictonary.sp dictonary.pt
Saikios