PCHomepage
Programmer
I have a site that is mostly bi-lingual already with separate MySQL entry "pages" for the two languages. Both languages currently show at the same time and it is no problem making only one or the other show depending upon the visitor's choice.
However, I don't want two separate copies of the various forms but I still want the text on them to be in one or the other language. Short of creating a table with a word or two in each field in two different languages to pull out individually, is there another way in PHP? I am thinking of having all the text for a given form in one field in English and in another field in the other language, then having some kind of substitution on the page. It would then be a simple matter of choosing one field or the other in order to get the selected language but I am not sure where to begin.
For example, there could be a field containing carriage-separated lines, such as:
EnglishText
lang:1:Name
lang:2:Address
lang:3:City
lang:4:Country
There would be a separate field in the same record with the other language.
The HTML part of the form would have
{lang:1]
{lang:2}
{lang:3}
{lang:4}
in place of each title that would be replaced on-the-fly with the appropriate language. Is this making any sense or I am I making it more difficult than it needs to be? Any help to get started will be appreciated.
However, I don't want two separate copies of the various forms but I still want the text on them to be in one or the other language. Short of creating a table with a word or two in each field in two different languages to pull out individually, is there another way in PHP? I am thinking of having all the text for a given form in one field in English and in another field in the other language, then having some kind of substitution on the page. It would then be a simple matter of choosing one field or the other in order to get the selected language but I am not sure where to begin.
For example, there could be a field containing carriage-separated lines, such as:
EnglishText
lang:1:Name
lang:2:Address
lang:3:City
lang:4:Country
There would be a separate field in the same record with the other language.
The HTML part of the form would have
{lang:1]
{lang:2}
{lang:3}
{lang:4}
in place of each title that would be replaced on-the-fly with the appropriate language. Is this making any sense or I am I making it more difficult than it needs to be? Any help to get started will be appreciated.