Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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