Jump to content

Overriding selected variables with file imports


netcoding

Recommended Posts

I have a question that I hope someone can help me.

 

I have many text strings (more than 200 items) defined in a few language files.

 

Here is an example.

 

file_english.php

text1 = "this is text 1 in English";

text2 = "This is text 2 in English";

 

file_spanish.php

text1 = "this is text 1 in Spanish";

text2 = "this is text 2 in Spanish";

 

file_french.php

text1 = "this is text 1 in French";

text2 = "this is text 2 in French";

 

When an url is processed, the code determines the "user language" (e.g. English) and imports the appropriate file.  So the web pages will be in English.

 

However, on one page, a user can select a different language (e.g. Spanish) in a drop down.  When the user clicks the submit button, the following page will display SOME text in Spanish, but the rest of the page (including the page title) is still in English.

 

Here is the question.

 

I would like to selectively override a few variables from different files in the code to display those text in a different language.  Is that possible?

 

Any help is much appreciated.

 

SS

 

 

 

 

 

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.