Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

changing language in left column


craigdblom

Recommended Posts

I've edited the "column_left.php" file with a series of links that bring up new .php pages, this bypasses the catalog categories that would have been in the column_left before. The pages these links bring up are modified, copied versions of the "contact_us.php" page. In these new pages I've inserted content (text and pictures) where the 'contact' form was in the 'contact_us' page.

 

What I need, is to be able to click on the language button (changing a language) and have the content of both the "column_left" file and modified "contact_us" pages change to accommodate the new language - in this case Spanish.

Link to comment
Share on other sites

Easy.

 

Just contruct the new pages like the original contact_us

 

Let's say your new page is named new_things.php

 

So, you go into your /includes/filenames.php add add a line about like this:

 

  define('FILENAME_NEW_THINGS', 'new_things.php');

Then you put all the text in "defines" in /includes/languages/english/new_things.php and the same in /includes/languages/espanol/new_things.php only translated into Spanish.

 

Like the contact us has this in those language files:

 

define('HEADING_TITLE', 'Contact Us');

define('HEADING_TITLE', 'Contactenos');

 

At the top of this new page (just like the contact_us) you'll have this:

 

  require('includes/application_top.php'); // this line already there

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEW_THINGS); // added this line

Then in the new_things.php when you want to show text on the page it's like this:

 

			<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

Easy as pie to switch languages.

 

osC is already set up for that, just code your pages like theirs.

;)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...