Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Language text link in header


emalenfant

Recommended Posts

Hi,

i have a little problem that should be easy to fix, i just don't know PHP :) I already put the link in the header to change language but what i want is only to display the alternative language ie: english when the page is in french and francais when the page is in english. I already edited french.php and english.php to include:

 

define('HEADER_LANGUAGE_SELECTION', 'francais'); --- english.php

define('HEADER_LANGUAGE_SELECTION', 'english'); --- french.php

 

but i don't find the way to include it in header.php , here is the code:

 

<td align="right" class="headerNavigation"><?php

if (!isset($lng) || (isset($lng) && !is_object($lng))) {

include(DIR_WS_CLASSES . 'language.php');

$lng = new language;

}

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

reset($lng->catalog_languages);

while (list($key, $value) = each($lng->catalog_languages)) {

if ($language != $value['directory'] ){

$languages_string .='<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency', 'action')) . 'language=' . $key, $request_type).'" class="headerNavigation">English | Francais</a>';

}

}

echo $languages_string;

}

?> | <?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> | <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> | <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> </td>

 

Help would be appreciated!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...