473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3285
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Amittai Aviram | last post by:
This XHTML 1.0 Strict page -- http://www.studiolirico.org/docs/settimana2003.html has a bilingual title in Italian and English. The principle language of the page is Italian, so the <html> tag...
30
by: Gustaf Liljegren | last post by:
I'm working with some semi-advanced tables with lots of decimal numbers in, and I can't get the alignment to work. http://www.algonet.se/~gustafl/temp/output_ib.html I want numbers aligned to...
2
by: G-Fit | last post by:
Hello group, I have several ASP.NET websites using (so far) a console application (from a collection of parameters, this application builds a PDF file through several professional tools in DOS...
2
by: Tim | last post by:
I am doing a small asp webshop and want to make it atleast bi-lingual. I have thought of a few ways to do this but would like to have a second opinion on what you think is the best way. I have...
2
by: robin | last post by:
The Oblique Strategies were originally a set of one-hundred cards, each bearing a short phrase. They were devised by Brian Eno and Peter Schmidt as ways of working through creative problems. When a...
2
by: Rog | last post by:
Hi, I have a bilingual report that should print amounts as 1,234.00 in the English(US) part --which is no problem-- and as 1.234,00 in the French part. My regional settings are US. How can I...
5
by: Peter | last post by:
Hi All, I am a novice .NET developer, using a 60 trial version of VS.NET 2003 to learn .NET. I would like to develop a website which can be accessed from a mobile device. What are my...
2
by: Giammarco | last post by:
Hi all, I'm developing an ASP.NET website and thinking about releasing the API through webservices in a couple of months (like flickr.com let's say). Most of the website functionality is...
0
by: origami.takarana | last post by:
Intrusion Detection Strategies ----------------------------------- Until now, we’ve primarily discussed monitoring in how it relates to intrusion detection, but there’s more to an overall...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.