473,544 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make mulitlingual website?

Hi

I need to make at mulitlingual website, with php amd mysql, and I am
looking for tutorils or books that explains about how to best do this.
Hop ypu have some suggestions as to were I can find information about
this.

Mads

Jul 17 '05 #1
18 2951
ma************@ gmail.com wrote:
Hi

I need to make at mulitlingual website, with php amd mysql, and I am
looking for tutorils or books that explains about how to best do this.
Hop ypu have some suggestions as to were I can find information about
this.

Mads


You could look into existing projects that offer it, phpMyFAQ for example
(www.phpmyfaq.de). Every bit of "Text" that pops up on the website later it
reads from a (big) associative array, specified by files (one for each
language) in the /lang/-directory. Depending on which language you choose,
the specific file gets included.
Jul 17 '05 #2
Should one place all the text in one big table, or is i better to place
it in several tabels. Should one make 4 colums one for each language,
or 4 rows one for each language?

Jul 17 '05 #3
On 27 Jun 2005 23:54:43 -0700, in comp.lang.php
"ma************ @gmail.com" <ma************ @gmail.com> wrote:
| Should one place all the text in one big table, or is i better to place
| it in several tabels. Should one make 4 colums one for each language,
| or 4 rows one for each language?


I use:
CREATE TABLE `usr_languages` (
`pageName` varchar(25) default '',
`itemNo` int(11) default '0',
`en` text,
`fr` text,
`it` text
) TYPE=MyISAM COMMENT='differ ent languages';

only because I can immediately see if I have not include text for a
particular language and a particular entry.

pageName: which page this text appears on
itemNo: order of items to be read and placed on page.
en/fr/it: the different languages.

I haven't optimised this as yet so the 'text' field is probably
overkill and a varchar(255) would suffice.
---------------------------------------------------------------
jn******@yourpa ntsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 17 '05 #4
ma************@ gmail.com wrote:
Should one place all the text in one big table, or is i better to place
it in several tabels. Should one make 4 colums one for each language,
or 4 rows one for each language?


Think - normalize, normalize, normalize.

Think - 4 columns - one for each language. What happens if you need to
add a fifth language? How much code will you have to change?

Several tables - again, if it's one for each language, how much code
will you have to change? Probably not as much. But in either case you
have to change the database.

One big table - I doubt it will be "big". "Big" in database-ese often
means terabytes. A couple of megabytes is nothing.

I would put things in one table with a layout similar to:

id: integer
language: char(2)
Actual info: text

Integer is not an auto-increment. Rather, it is some id you generate
for each page. The combination of id and language (2 character ICANN
country codes works great in most cases) is used for the primary key.

In you code for a specific page, the id never changes, the language is
based on what they select.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jul 17 '05 #5
Ok, thanks. Have you seen a tutorial / book or something like that
about the subject?

Jul 17 '05 #6
Ok, thanks, I am going to try it. Have any of you seen a tutorial /
book or something like that about the subject? - perhaps from wrox.

Jul 17 '05 #7
Is what you are suggesting something along these lines?

or do you agree with Jeff?

CREATE TABLE `usr_languages` (
`pageName` varchar(25) default '',
`id` int(11) default '0',
`language` char(2),
`Actual_info` text,
)

Jul 17 '05 #8
Well, it all depends on what your site is and what the languages are.
Localization is a very large topic. You should spend some time looking
at the big picture first before diving into the technical nitty-gritty.
For example, if your site accepts user input, you have to think about
how to deal with the differences in notation and format. Just yesterday
I accidently wrote out a check for $9800 because the application
doesn't understand that 98,00 means 98.00.

Page layout can also be a challenge. A layout that works for one
language might not for another. In English, for example, you could have
something like

I would like to buy a[LIST BOX]

A page design that requires the list box label to be on the left side
would be bad, as the object might need to appear at the beginning or
the middle of the sentence in other languages. Sometimes a problem
could be as simple as not being able to fit a word into a given space.

The difficulty of handling multiple languages in a single codebase is
why people often build a separate site per language instead.

Jul 17 '05 #9
ma************@ gmail.com wrote:
Is what you are suggesting something along these lines?

or do you agree with Jeff?

CREATE TABLE `usr_languages` (
`pageName` varchar(25) default '',
`id` int(11) default '0',
`language` char(2),
`Actual_info` text,
)


No, I do not agree with Jeff. His design, while it works, makes the code very
difficult to modify should he ever want to add a new language. To do so would
require changing the database - and an examination of all the code which
accesses the database. No, all the code would not HAVE to be modified - but all
would have to be inspected.

Normalizing the database helps with these effects. You don't need to change
column names in your queries, for instance. It means if you have a bad language
value (i.e. no sw(ahili) column), you get no data back instead of a MySQL query
error.

The method you quoted is much clearer - except you really don't need an "id"
column. Rather, the primary key should be "pageName, language".

I don't have any tutorials in mind - but if you do a google search on "database
normalization" you should find several.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1783
by: Lovely Angel | last post by:
Dear Friends Hope you all doing great First, thanks for making life easier for me, by helping me whenever I needed you. Its been quite sometime that I have worked on websites, designing them, programming backend database, for them and others. But till now I havent worked on a project which could prepare me for m current project. My...
1
1494
by: Serdge Kooleman | last post by:
howto make website similar to microsoft website. could you advise a book or walktrough... i want to repeat this website thank you
19
2245
by: Swaregirl | last post by:
Hello, I would like to build a website using ASP.NET. I would like website visitors to be able to download code that I would like to make available to them and that would be residing on my personal server. Are there any code samples or books that someone can recommend so that I can implement this. I would prefer VB.NET code, but I am...
17
2260
by: stubbsie | last post by:
Hi, I have redesigned our official public government website in .net and it has taken me a few months to redo. I have been the sole designer of the website from its humble beginnning a few years ago when no one wanted to even mess with it. Since then I have been steadily maintaining it and improving it. I am about halfway done, and all of a...
38
5038
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
3
1348
by: skneife | last post by:
it seems that it is not possible to make a project Reference from a project class library to a website in the same solution, because the website doesn't contains any assembly (dll). So, if in the same solution I have a project of type class librairy and I want to make a reference to a website that contains any classes that I need to use, the...
1
1485
thatos
by: thatos | last post by:
I have a site which could help some people who are struggling in python this website has some examples of python which some people might find useful I would like to know how can make it to get more visits I currently receive on average 100 visits per month and the only website which has a link to that site which I get more visits through is...
1
1328
by: czi02 | last post by:
Hi there what are the software to make an simple website.Besides of photoshop, dreameweaver, how can you make a webiste. Is there an free host to make able to make a website?
1
47373
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or...
0
7438
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7374
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7632
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7783
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7392
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
4930
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3422
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1850
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.