Join us at IRC!
I'd prefer to die standing, than to live on my knees - Che Guevara
Thursday, May 24, 2012
Navigation
Members Online
Total Online: 33
Web Spiders: 16
Guests Online: 30
Members Online: 3

Registered Members: 70201
Newest Member: subnick
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

multi-language website

mistake25
Member

Posts: 30
Location:
Joined: 08.01.07
Rank:
God
Posted on 01-09-08 19:08
hi,
i want ask, what is the best opinion to make multilanguage site, sotre translations in array, or in database? or something else, thanks


Author

RE: multi-language website

Coder Disaster
Member

Posts: 92
Location: BIOS
Joined: 01.09.08
Rank:
Newbie
Warn Level: 20
Posted on 01-09-08 19:15
I have done it like so

eng.inc.php

$word_1 = "English word";


otherlang.inc.php

$word_1 = "Other lang word";


main.php
session_start();
if(isset($_GET['lang']))
{
if($_GET['lang'] == 1)
{
include eng.inc.php;
}
}
echo $word_1;


That should start u off in the right direction .

Btw this is just an example, it will need security etc.


Im a coding disaster

Edited by Coder Disaster on 01-09-08 19:16
coder_disaster@hotmail.co.uk
Author

RE: multi-language website

Zephyr_Pure
Member



Posts: 2402
Location:
Joined: 15.09.06
Rank:
God
Posted on 01-09-08 19:20
http://alma.ch/blogs/bahut/2006/03/simple-multi-language-web-site.html

Second result when Googling "multi-language website".


I still check PMs from time to time.




Our responses were moronic, why shouldn't he follow suit? - Futility
Author

RE: multi-language website

mistake25
Member

Posts: 30
Location:
Joined: 08.01.07
Rank:
God
Posted on 01-09-08 19:24
2 Zephyr_Pure: yes i know i can use google, but i want to know yours opinion


Author

RE: multi-language website

Coder Disaster
Member

Posts: 92
Location: BIOS
Joined: 01.09.08
Rank:
Newbie
Warn Level: 20
Posted on 01-09-08 19:26
I hate them pre-made codes, i always like to write my own.

:D


Im a coding disaster
coder_disaster@hotmail.co.uk
Author

RE: multi-language website

Zephyr_Pure
Member



Posts: 2402
Location:
Joined: 15.09.06
Rank:
God
Posted on 01-09-08 19:38
mistake25 wrote:
2 Zephyr_Pure: yes i know i can use google, but i want to know yours opinion


Okay... my opinion is that you should use a db with tables for your different content areas and translations for each language, then dynamically populate your pages based upon the language that your visitor chose (and had set through a session variable by your code, most likely).


I still check PMs from time to time.




Our responses were moronic, why shouldn't he follow suit? - Futility
Author

RE: multi-language website

Coder Disaster
Member

Posts: 92
Location: BIOS
Joined: 01.09.08
Rank:
Newbie
Warn Level: 20
Posted on 01-09-08 19:42
I dnt think that a database is needed for this, just either flat file system , or an .inc file should do, but depends on how much content you want to change.


Im a coding disaster
coder_disaster@hotmail.co.uk
Author

RE: multi-language website

Zephyr_Pure
Member



Posts: 2402
Location:
Joined: 15.09.06
Rank:
God
Posted on 01-09-08 19:47
Coder Disaster wrote:
I dnt think that a database is needed for this, just either flat file system , or an .inc file should do, but depends on how much content you want to change.


It's not needed for that, no... nor did I state it was. I gave my suggestion. Is it necessary to have multiple directories and files holding the same content in different languages? No... but, that doesn't make your suggestion any less valid, either.


I still check PMs from time to time.




Our responses were moronic, why shouldn't he follow suit? - Futility
Author

RE: multi-language website

Coder Disaster
Member

Posts: 92
Location: BIOS
Joined: 01.09.08
Rank:
Newbie
Warn Level: 20
Posted on 01-09-08 19:50
I wasnt having a go at you, i assumed you meant use a database to store the translations.

BUt it all depends on how much content he wants to change.


Im a coding disaster
coder_disaster@hotmail.co.uk
Author

RE: multi-language website

Zephyr_Pure
Member



Posts: 2402
Location:
Joined: 15.09.06
Rank:
God
Posted on 01-09-08 20:00
Coder Disaster wrote:
I wasnt having a go at you, i assumed you meant use a database to store the translations.

BUt it all depends on how much content he wants to change.


I did. It depends on how easily expandable he wants it to be, not on how much content he wants to change.

The purpose of a dynamic website driven by database content and static includes is to not have to modify the source every time you want to add a change. For instance, if he decides he wants to add Hebrew to the site at some point, he shouldn't have to manually add it to the included select object listing the languages and to the conditionals in his code that are populating the correct content. Instead, the site should pull all of the available languages from the db when the main page is loaded (to populate the select options), then just run the same queries to pull content based upon the value of a session variable... as compared to the language entry in the db. He could easily add 5, 10, or 100 languages this way.

So, you have a point... and there are different ideal solutions based upon the scope of his idea.


I still check PMs from time to time.




Our responses were moronic, why shouldn't he follow suit? - Futility
Author

RE: multi-language website

Coder Disaster
Member

Posts: 92
Location: BIOS
Joined: 01.09.08
Rank:
Newbie
Warn Level: 20
Posted on 01-09-08 20:05
Yer i agree with that ^^.

If you want i can help you design the DB structure, and create the code.


Im a coding disaster
coder_disaster@hotmail.co.uk
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.