Jump to content

language for website


fullyloaded

Recommended Posts

Well theres a few ways to do this that I can think of.

Option 1 :
Different folders for each language. Like such:

www.yourweb.com/en/index.php
www.yourweb.com/fr/index.php
www.yourweb.com/gr/index.php
etc

Option 2 :
At the top of the page you could have it read files depending on which language you want, and instead of putting normal text you would have to echo variables. These variables change from file to file depending on what files are opened.

Option 3 :
Like option 2 but instead all the text is saved to a database in a format like so...

[font=courier new]
+----+----------+-----------+---------+
| id | language | fieldname | text    |
+----+----------+-----------+---------+
| 1  | french  | mainText  | le bleh |
| 1  | english  | mainText  | bleh    |
+----+----------+-----------+---------+
[/font]

Then retrieve and display each field name depending on which language they selected

Option 4 :
Downloading some obscure PHP script to translate text, ending up with babble fish text that is only understandable in the language it was first written in.


* Option 2 and 3 would most likely need cookies to save which language the user selected. Option 1 would be the simplest and least confusing for a first timer. Option 3 would be what I would go with personally because I believe that I could make a pretty spiffy page program. Option 1 would be vary difficult when you need to edit something though.
Link to comment
https://forums.phpfreaks.com/topic/33551-language-for-website/#findComment-157118
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.