Forum Moderators: coopster

Message Too Old, No Replies

Multiple language website

         

rizwan

8:56 am on Jul 25, 2005 (gmt 0)

10+ Year Member



how can i develop diffrent language ver. for the website

this site is in two languages arabic and english as well. plz help me... thanx

[edited by: coopster at 2:08 pm (utc) on July 25, 2005]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]

mcibor

9:25 am on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are very many different approaches to that.

1. You can use templates and fill them in with correct language
2. You can use includes for various languages

You can use db to store language data

Really depends on the type of the page. Wheather it's different language articles or informational page.

If the page is small I recommend using includes. If it's big then change to templates and db

best regards
michal Cibor

rizwan

10:52 am on Jul 25, 2005 (gmt 0)

10+ Year Member



thanx for sug... michal

but please tell me which function or code should i use to translate the content of website to a specific language.if any one have example or link please sug.. me

i will create diffrent templates for diffrent languages.

vincevincevince

11:09 am on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Within your text, place PHP variables, such as $1, $2, $3

e.g. "<b>$1</b>";

At the top of your page, include a specific language file:
include("/languages/$language.php");

The language file is of the format:

$1="Something";
$2="Something else";

You then need to decide which language to include. Try using GET to start with, then extend it to use SESSIONS once you've figured out GET.

$language=$_GET['language'];
include("/languages/".intval($language).".php");

Now, if you have three languages, language files named 1.php, 2.php, 3.php

You can load the corret language as:

http:// yoursite .com/ index.php? language=1 (or 2 or 3)

mcibor

11:15 am on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



All I can think of now is this simple example:
In db are fields: lang, title, menu_contact...
template_index.php:
<!DOCTYPE....
<head...
<title><?php echo $template["title"];?></title>
...
<body><p class="menu"><a href="contacts.php?lang=<?php echo $lang;?>"><?php echo $template["menu_contact"];?></a></p>

etc...

index.php:

<?php
//get language:
if(!($_not_validated_lang = $_POST["lang"])) $_not_validated_lang = $_GET["lang"];
//validate it:
switch ($_not_validated_lang) {
case "de" :
case "pl" :
case "it" :
$lang = $_not_validated_lang; break;
default :
$lang = "en"; }
//get info from db for specified language
$sql = "SELECT * FROM template WHERE language='$lang'";
//connect, query and use mysql_fetch_assoc() to get $template
//then
include("template_index.php");
?>

Hope this helps
Michal Cibor

rizwan

12:43 pm on Jul 25, 2005 (gmt 0)

10+ Year Member



sorry dear, i think u can't understand my question yet, actuly tell me how to write/translate a text to a specific language like arabic.

i create a page in arabic as follow:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html>
<head>
</head>
<body>
دسم قليل ورشاقة أكثر
</body>
</html>

but its explorer scroll bar is on the right which is for english language that sould b on tihe left side plz help me...

abbeyvet

1:00 pm on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Translation is not done automatically. Someone needs to do it.

You can opt to use an automated translater - I don't know of one for Arabic, though there may be some out there. But with automatic translation the quality of the translated content will be poor at best.

mcibor

9:04 pm on Jul 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To translate some web page to arabic:
Get the translation (from the translator, best would be an Arab speaking your language)
Get the coding right (I don't know which it is: iso-8955-13? no idea.)
Write the html to make scrollbar on the left
Write html to make text aligned to right

Best would be to go to some arabic page and see the source code.
Best regards
Michal Cibor