Follow us on Twitter!
The important thing is not to stop questioning. - Albert Einstein
Friday, April 25, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 20
Guests Online: 18
Members Online: 2

Registered Members: 82909
Newest Member: awais
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

multi-language website


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-09-08 19:15
I have done it like so

eng.inc.php
Code

$word_1 = "English word";





otherlang.inc.php
Code

$word_1 = "Other lang word";





main.php
Code
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.




Edited by on 01-09-08 19:16
Author

RE: multi-language website


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-09-08 19:20
http://alma.ch/bl. . .-site.html

Second result when Googling "multi-language website".


Author

RE: multi-language website


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-09-08 19:26
I hate them pre-made codes, i always like to write my own.

Grin


Author

RE: multi-language website


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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).


Author

RE: multi-language website


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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.


Author

RE: multi-language website


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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.


Author

RE: multi-language website


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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.


Author

RE: multi-language website


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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.


Author

RE: multi-language website


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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.