473,804 Members | 3,526 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 2986
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
1810
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 current project is for an organization which publishes its magazine
1
1509
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
2284
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 willing to convert from C# if necessary.
17
2295
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 sudden my supervisor won't let me make the website in .net. Our programmers use .net to make web...
38
5083
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
1364
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 add reference menu doesn't reference any project for the website. Does anyone have a solution ? ...
1
1501
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 wikipedia I want to know were can I place I link to my site. I even tried to follow google's webmaster...
1
1349
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
47494
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 “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
9708
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9588
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10589
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10327
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7625
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
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

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.