Triffid
Posts: 6
|
| Posted: 03/01/2005, 8:53 AM |
|
I am working on an application that needs to be available in multi-language format. So far i can come up with 3 solutions:
1. Store all fields and their translations in MySQL, retrieve when page loads with Select queries.
2. Make an includable php language file , which contains all the fieldlabels with their translation in array format. include this file on every page that needs translation and parse from array. (PHPBB2 like)
3. Store all the fieldlabels as a complete array in session variables once upon login, and parse the field label with a GetSession.
Option 3 seems most effective, but i'm not an expert on this.
Ideas anyone ?
|
 |
 |
RonB
Posts: 228
|
| Posted: 03/01/2005, 10:08 AM |
|
Since you labeled it performance consideration I think you should keep in mind the basic rule:
Do not let your serverside code do the work you could do with the database. In general the database is quicker so it will enhance the performance.
I'd go for option 1 and set language as a session variable. This way all you have to do is add a where argument in your grid queries to decide wich labels to display.
Ron
|
 |
 |
Damian Hupfeld
|
| Posted: 03/09/2005, 3:48 AM |
|
I am playing with this concept also.
Something else to bear in mind is are you going to have a FIXED number of
languages only, or will you add more languages later?
If the number of languages is going to be dynamic you will possibly want to
split certain elements up further like graphics...
Images will be the same across all languages so you would want them in a
seperate table to the text.
I hope that made sense.
Oh yeah, I would also let the DB do the work... but thats only cos thats how
I thought would be the easiest way to do it.
Damian
"RonB" <RonB@forum.codecharge> wrote in message
news:54224afb970ef6@news.codecharge.com...
> Since you labeled it performance consideration I think you should keep in
> mind
> the basic rule:
>
>
> Do not let your serverside code do the work you could do with the
> database.
> In general the database is quicker so it will enhance the performance.
>
>
> I'd go for option 1 and set language as a session variable. This way all
> you
> have to do is add a where argument in your grid queries to decide wich
> labels
> to display.
>
> Ron
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|