469,902 Members | 1,963 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,902 developers. It's quick & easy.

Strategies for developing a bilingual website?

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
language.
Any ideas would be appreciated.

Dec 2 '05 #1
5 3125
will wrote:
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
language.
Any ideas would be appreciated.

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
Choice...
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..

Dec 2 '05 #2
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.

Dec 2 '05 #3
Following on from will's message. . .
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
language.
Any ideas would be appreciated.

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 mysite.com/en/.... and mysite.com/fr/... 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
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Dec 2 '05 #4
I have done this in the past (see www.jasww.com 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

e.g.

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
problems.

Ian

Dec 2 '05 #5
will wrote:
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.


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

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 2 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Amittai Aviram | last post: by
30 posts views Thread by Gustaf Liljegren | last post: by
2 posts views Thread by robin | last post: by
reply views Thread by origami.takarana | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.