Re: Language file, Best practice
- From: Mike P2 <sumguyovrthar@xxxxxxxxx>
- Date: 28 Apr 2007 10:26:11 -0700
On Apr 23, 2:05 am, FFMG <FFMG.2ph...@xxxxxxxxxxxxxxxxxxx> wrote:
Hi,
I would like to add international support for my site to allow some of
my users to translate the site if they really feel the urge to do it.
So, what is the best way, so far, of handling languages?
I think phpBB and similar use files for language for portability and
ease of updating. I would save smaller strings (like messages, link
text, page titles) into a database and retrieve the needed language on
each page. I think SQL caching should be effective here because each
language should use the same query every time.
If you think it would be faster, you can save it in both the database
and into files (into a PHP file, with array assignments), and each
time it needs to be updated the form is filled with data from the
database, and then when the form is submitted the data would be
updated in the database and the language file would be regenerated
with that new data. Then the files that use the language would include
the appropriate language file instead of querying the database each
time (useful if the table gets big and the queries start taking too
long). I've benchmarked with 100 rows of data and 100 files, and found
that retrieving an indexed row from the database is about twice as
fast as reading the file named with that index. I've been told that
the database would be even faster in comparison if there were more
files and rows.
-Mike PII
.
- Follow-Ups:
- Re: Language file, Best practice
- From: Mike P2
- Re: Language file, Best practice
- References:
- Language file, Best practice
- From: FFMG
- Language file, Best practice
- Prev by Date: Re: Error with ocilogon() : OCIEnvNlsCreate() failed
- Next by Date: Re: Language file, Best practice
- Previous by thread: Language file, Best practice
- Next by thread: Re: Language file, Best practice
- Index(es):
Relevant Pages
|
Loading