Strategies for developing a bilingual website?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a php/mysql site and I am wondering if anyone has suggestions
about strategies for making it bilingual or resources on how to do
this. I thought of one way which would be to replace the text with
calls to a database which has all the text in it. But I would prefer to
have a single file with phrases and then just be able to translate that
single file into another language to produce a site in another
Any ideas would be appreciated.

Re: Strategies for developing a bilingual website?

will wrote:
Quoted text here. Click to load it
I am wondering about the same thing... I believe that a database with a  
table that stores all the languages and a table that stores all your  
text in fields associated with your content and the lunguage is the best  
I haven't tried it yet to give you an exact solution/example but  
something like that should work.
Also it might be a different table for the content an other for the menu  
or you can create categories. So each phrase you add in the database  
will be associated with a Language and A category..

Re: Strategies for developing a bilingual website?

I was also thinking about this. I think you can create a single text
file called something like allText.txt. On each line you can have a
sentence, phrase, or word that needs to display on the site. Then in
your php files for the site you can make calls to read from this text
(I think php must have ways to read from text files as an alternative
to reading from a database) file. This might be easier than using a
database because if you want the site translated into another language
you just need to translate that one text file. I would be interested in
knowing whether anyone has comments on this.

Re: Strategies for developing a bilingual website?

will wrote:
Quoted text here. Click to load it

It may be easier to translate but it will be much harder to code for and  

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: Strategies for developing a bilingual website?

Following on from will's message. . .
Quoted text here. Click to load it
Some thoughts:
* If the functionality in all languages is the same then some form of  
lookup is practical.  If on the other hand you are developing a  
multi/national/ web site where perhaps you will have different forms for  
different data (eg postal addresses and taxes may be different) then you  
probably want to have and pages.

* There are three phases to 'translation'  (1) - The initial page  
design/test and (2) Ongoing maintenance of pages  (3) Frequently changes  
messages (offer of the day etc)
Item (3) looks like a database with built-in maintenance function the  
users can play with.
Items (1) and (2) I would handle by creating a master version in my home  
language and translate once (rather than add server load at every page  
access to do exactly the same thing over and over again) to clone  
other-language copies....

...You'd need a defined development process,
I'd have texts in my master as eg "~WELCOMEMSG~Welcome to my web site.  
For a French version <a href="../fr/index.htm>click here</a>~" and write  
a macro processor that can (a) extract the texts from all my pages to  
pass to a qualified translator and (b) create final php copies with the  
leading key removed and text substituted with the language of your  
choice.  Using this scheme you can thoroughly test albeit with extra key  
words in your text and leave translation to somebody who is good at it.

PETER FOX Not the same since the poster business went to the wall
2 Tees Close, Witham, Essex.
Gravity beer in Essex  <

Re: Strategies for developing a bilingual website?

I have done this in the past (see or any other jas site -
they are all really the same site).

We did it with messages in a database (it's CF, but the principle is
the same).
You could use resource files and include the language of choice -
syncing is a problem here
You can write the site in English and go and get a translation


echo translate("Welcome");

where translate()...
 returns English immediately if language reqd is English
 looks up translation in file/db and returns it if found
 if translation not found, writes to a log and returns the English

A couple of things to remember, whichever way you do it:

The site needs a liquid layout - message strings will vary in length
Have long messages, eevn if you are sure you can split them up, don't
do it.
   Trying to create a message (even a paragraph) from bits is
hazardous. Translating each word in a sentence one by one
obviouslygives pathetic results. even sentence by sentence gives


Site Timeline