dzingai Posted July 31, 2007 Share Posted July 31, 2007 Hie you all I am tryingto redevelop my website to include affiliate offices in some countries. In one country, they speak both English & Portuguese while in the others they speak English. What I would like is this: someone clicks a particular country (or uses the form on the page) and is led to country.php where if (country name is set) select country details and also print English links and the name of the country. if (country) is the portuguese_and_english_country, print the English links and also a link to change the language to Portuguese. ... and if Portuguese is selected, print Portuguese links and the name of the country. The page is divided into two top rows for the masthead (first) and links (second), then the third row has three columns, with the middle one being the one for the main website content. Can anyone tell me how I can go about it? Thanx Quote Link to comment https://forums.phpfreaks.com/topic/62648-changing-language-on-a-site/ Share on other sites More sharing options...
soycharliente Posted July 31, 2007 Share Posted July 31, 2007 This is probably not the best way to do it, but since no one else has answered, I'll post a way that I thought of: Any text that you want to be translated should go into a database. You can set it up however you want. But the naming convention for all of the tables should have the language as the first word. Obviously, two tables will have the data same, just in different languages. - english_homepagestuff - portuguese_homepagestuff - english_links - portuguese_links Then use a session variable to store what language they select. Just append the language to the front of whatever table you call and the data for that language will be pulled. Let the optimizing begin... Quote Link to comment https://forums.phpfreaks.com/topic/62648-changing-language-on-a-site/#findComment-311824 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.