Jump to content

changing language on a site


dzingai

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/62648-changing-language-on-a-site/
Share on other sites

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...

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.