473,385 Members | 1,848 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,385 software developers and data experts.

create web page in multiple language

hello

vishal here

i want to craete site which shows the contents as per the langauge i
choose. so can anyone give me idea that how this is possible. i know
tha problem but i don't have any idea about soultion. so pls reply me
if u know

thxs in advance...........

Jul 17 '05 #1
3 2065
vishal <vi************@yahoo.co.in> wrote:
i want to craete site which shows the contents as per the langauge i
choose. so can anyone give me idea that how this is possible. i know
tha problem but i don't have any idea about soultion. so pls reply me
if u know


I have this solotion for my site:
files:
lang.hr.php
lang.en.php
lang.de.php
with langugae variables in files:
(hr)
$welcome = "Dobrodosli";
(en)
$welcome = "Welcome";
(de)
$welcome = "Willcomen";
and so on...

Then, I give my visitors cookie $_COOKIE['lang'], as my site is primary
for croatian vistors, I just look if visitor have choosen other language
on his visit before (that was *my-clumsy-english*...sorry):

//"gui" part
if(isset($_COOKIE['lang'])) {
$lang = "$_COOKIE[lang]";
} else {
$lang = "hr";
}
include("lang/lang.$lang.php");

//site content
mysql_query("SELECT * FROM table WHERE (somthing='$wanted_content' AND
lang = '$lang')";

//in case of some old not yet converted static data:
include("data/$lang/$linked_file");

.... that wasn't "copy-paste" method, so some "typing errors" are
possible...

--
Jan ko?
http://fotozine.org/?omen=janimir
--
Jul 17 '05 #2
"vishal" <vi************@yahoo.co.in> wrote in
news:11**********************@o13g2000cwo.googlegr oups.com:
hello

vishal here

i want to craete site which shows the contents as per the langauge i
choose. so can anyone give me idea that how this is possible. i know
tha problem but i don't have any idea about soultion.


One method, that is suitable in some circumstances
(but not all) is to use gettext
http://www.php.net/manual/en/ref.gettext.php

Another approach would be to use the PEAR
Translation2 class:
<http://pear.php.net/manual/en/packag...ranslation2.ph
p>

--
Dave Patton
Canadian Coordinator, Degree Confluence Project
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Jul 17 '05 #3
"vishal" <vi************@yahoo.co.in> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
hello

vishal here

i want to craete site which shows the contents as per the langauge i
choose. so can anyone give me idea that how this is possible. i know
tha problem but i don't have any idea about soultion. so pls reply me
if u know

thxs in advance...........


That depends on what the languages are. The solution for handling English,
French, and German is quite different from handling English, Chinese, and
Arabic.
Jul 17 '05 #4

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

Similar topics

0
by: Guy Deprez | last post by:
Hi, i'm having a problem to create indexes. STEP 1 ----------- Connection is OK (you can find the string at the end of the message) Table ("Couleurs") creation is OK STEP 2. Index Creation
3
by: Varad | last post by:
Hi all Pls give me some insight as to what I should be doing. I have a form where I have 20 text boxes and when an user submits the form I save it to a database. When they want to retrieve it, I...
1
by: Robizzle | last post by:
I'm writting a script that produces html source code from form input. My problem is that I want to format my html source with new lines and tabs. So, I have a string that holds all the contents...
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
1
by: rushikesh.joshi | last post by:
Hi All, I want some charting functionality in my ASP.NET application. I want to show a multiple bar on my web page. It's based on down time of different servers. like server1: down betn 4 AM...
3
by: rgparkins | last post by:
Hi This has been asked before but with no resolution so I am putting it out there again in case someone has an answer. 2 user controls with same name List.ascx but different namespace, and I...
3
by: imrantbd | last post by:
I need array type name like "destList" must use for my destlist select box,not a single name.Or need a solution to capture multiple value of "destList" select box and send all selected value in php...
5
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.