Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Is it possible to have different images for different languages??

Is it possible to have different images for different languages??

Views: 2,575

Results 1 to 20 of 25
11 Feb 2011, 7:44 PM
#1
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Is it possible to have different images for different languages??

Hello! I have a multi language website (alepia.ch) and i'm working into a new template so I was wondering if it is possible to have a different image for every different language like for the french an image written in french, same for italian and english.:blush:
Thank you

11 Feb 2011, 8:51 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Is it possible to have different images for different languages??

here is no builtin facility for different product images per language

If you are talking about template images applied through a stylesheet
Then look at the readme in your /css directory about different stylesheets

12 Feb 2011, 4:55 PM
#3
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: Is it possible to have different images for different languages??

I want to change the logo.gif image for every language and also for the banners... I can't do this in the stylesheet!!

12 Feb 2011, 5:10 PM
#4
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: Is it possible to have different images for different languages??

I have no suggestion for your problem, but a correction for the Italian
On the top menu bar it should read "per i professionisti" instead of professionali

17 Feb 2011, 7:31 AM
#5
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: Is it possible to have different images for different languages??

Thank you! I'll change the wrong translation as soon as possible!!

But going back to the problem... can I have different home logo and banners for every different language that I have ??

17 Feb 2011, 2:38 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

Re: Is it possible to have different images for different languages??

The logo image is specified by the file(s) /includes/languages/LANGUAGE/YOUR_TEMPLATE/header.php:

// added defines for header alt and text
  define('HEADER_ALT_TEXT', 'Powered by Zen Cart :: The Art of E-Commerce');
  define('HEADER_SALES_TEXT', 'TagLine Here');
  define('HEADER_LOGO_WIDTH', '192px');
  define('HEADER_LOGO_HEIGHT', '64px');
  define('HEADER_LOGO_IMAGE', 'logo.gif');

If your site supports english, french, and italian and your template name is TEMPLATE, then you would have 3 files:

/includes/languages/english/TEMPLATE/header.php
/includes/languages/french/TEMPLATE/header.php
/includes/languages/italian/TEMPLATE/header.php

You could have 3 separate logo files (named, for example, logo_en.gif, logo_fr.gif and logo_it.gif) that are specified by the language-specific header.php file. All the logo files would be located in the /includes/templates/TEMPLATE/images directory.

17 Feb 2011, 4:30 PM
#7
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,608
Plugin Contributions:
0

Re: Is it possible to have different images for different languages??

Lat9 is correct- specify your logo image name in the Language file.

8 May 2011, 3:36 AM
#8
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: Is it possible to have different images for different languages??

It is not working with me though... actually I changed every header.php file in each language but english (where it is logo.gif) but it still shows the logo.gif and not logo_fr.gif in french, for instance! Why it is not working with me?
Anyways I would like to know whether it is possible to do such a thing (different banners for different languages) also with the banners and how to do so!
The website is : ALEPIA-TEMPLATE1, it is still a work in progress ;)
Thanks in advance!

8 May 2011, 3:42 AM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Is it possible to have different images for different languages??

It is not working with me though.
Post the file name and path to it for each

8 May 2011, 12:18 PM
#10
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: Is it possible to have different images for different languages??

Isn't the logo specified in tpl_header.php instead of /languages/TEMPLATE/header.php ??
@Kobra : Do you want the link of each logo?

8 May 2011, 8:03 PM
#11
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Is it possible to have different images for different languages??

Isn't the logo specified in tpl_header.php instead of /languages/TEMPLATE/header.php ??
NO

That is why I am asking you to post the file name you have edited and the path to the file for each language

8 May 2011, 10:42 PM
#12
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: Is it possible to have different images for different languages??

the path is
For French logo:

/includes/templates/template25221/images/logo_fr.gif

For Italian logo:

/includes/templates/template25221/images/logo_it.gif

Then for the banners i uploaded them all in:
/images/design/banner*_XX.jpeg where * is number of banner (ie. 1,2and3) and XX stands for it or fr depending on the language

8 May 2011, 10:55 PM
#13
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: Is it possible to have different images for different languages??

alepia:

the path is
For French logo:

/includes/templates/template25221/images/logo_fr.gif

For Italian logo:

/includes/templates/template25221/images/logo_it.gif

Then for the banners i uploaded them all in:
/images/design/banner*_XX.jpeg where * is number of banner (ie. 1,2and3) and XX stands for it or fr depending on the language
For the logo part:
it is
www/testing2911/includes/templates/template25221/images/logo_fr.gif

9 May 2011, 2:15 AM
#14
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Is it possible to have different images for different languages??

You need to review lat9's post #6

You need to have a couple(one for each language) header.php files

path will be similar to

/includes/languages/french/template25221/header.php
/includes/languages/italian/template25221/header.php
and so on

9 May 2011, 2:24 AM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Is it possible to have different images for different languages??

Your Template Monster template has the logo in .header_t .col1 a img instead of #headerWrapper #logoWrapper #logo a img, so it is possible that they have hacked the header code so that it no longer uses language-specific files for the logo.

10 May 2011, 3:05 PM
#16
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: Is it possible to have different images for different languages??

gjh42:

Your Template Monster template has the logo in .header_t .col1 a img instead of #headerWrapper #logoWrapper #logo a img, so it is possible that they have hacked the header code so that it no longer uses language-specific files for the logo.
@gjh42 what shall I do to change it back?

10 May 2011, 3:10 PM
#17
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Is it possible to have different images for different languages??

We can't answer that without seeing the TM versions of files (probably tpl_header.php). Just substituting stock versions would break the template; you would need to find the logo output code and compare it with the stock logo output to know what is different... if that is actually the problem (can't tell from here).

12 May 2011, 2:23 PM
#18
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: Is it possible to have different images for different languages??

tpl header:

<?php /** * Common Template - tpl_header.php * * this file can be copied to /templates/your_template_dir/pagename<br /> * example: to override the privacy page<br /> * make a directory /templates/my_template/privacy<br /> * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br /> * to override the global settings and turn off the footer un-comment the following line:<br /> * <br /> * $flag_disable_header = true;<br /> * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $ */ ?> <?php // Display all header alerts via messageStack: if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) { echo htmlspecialchars(urldecode($_GET['error_message'])); } if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) { echo htmlspecialchars($_GET['info_message']); } else { } ?> <!--bof-header logo and navigation display--> <?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?> <div class="header_t"> <div class="col1"><img height="41" width="1" alt="" src="includes/templates/template_default/images/pixel_trans.gif"><br> <a href="<?php echo zen_href_link(FILENAME_DEFAULT);?>"><?php echo zen_image(DIR_WS_TEMPLATE.'images/logo.gif'); ?></a> <br> </div> <div class="col2"> <div class="r1 user_menu"><img height="12" width="1" alt="" src="includes/templates/template_default/images/pixel_trans.gif"><br> <ul style="float: right;"> <li class="first"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li> <?php if ($_SESSION['customer_id']) { ?> <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li> <?php } else { if (STORE_STATUS == '0') { ?> <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li> <?php } } ?>
  	<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
  		<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
  		<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
  	<?php }?>
  	</ul>
    <div class="clear"></div>
  </div>
  <div class="r2">
    <table style="float: right;">
      <tbody><tr>
        <td style="width: 83px;"><?php echo BOX_HEADING_LANGUAGES; ?>:<br>
        </td>
        <td>
  		<!-- ========== LANGUAGES ========== -->
  		<?php if (!isset($lng) || (isset($lng) && !is_object($lng))) {
  			$lng = new language;
  		  }

  		  reset($lng->catalog_languages);

  		  while (list($key, $value) = each($lng->catalog_languages)) {
  			echo '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . zen_image(DIR_WS_LANGUAGES.$value['directory'].'/images/'.$value['image'], $value['name'], '', '', ' style="vertical-align:middle;"') . '</a>';
  		  }
  		 ?>				
  		<!-- =============================== -->
        </td>
      </tr>
    </tbody></table>
    <div class="clear"></div>
  </div>
  <div class="r3">
    <table style="float: right;">
      <tbody><tr>
        <td><img height="4" width="1" alt="" src="includes/templates/template_default/images/pixel_trans.gif"><br>
          <?php echo BOX_HEADING_CURRENCIES; ?>:<br>
        </td>
        <td style="width: 134px; text-align: right;">
        
  		<?php echo zen_draw_form('currencies', zen_href_link(basename(ereg_replace('.php','', $PHP_SELF)), '', $request_type, false), 'get')?>
  		<?										
  			if (isset($currencies) && is_object($currencies)) {						
  			  reset($currencies->currencies);
  			  $currencies_array = array();
  			  while (list($key, $value) = each($currencies->currencies)) {
  				$currencies_array[] = array('id' => $key, 'text' => $value['title']);
  			  }										
  			  $hidden_get_variables = '';
  			  reset($_GET);
  			  while (list($key, $value) = each($_GET)) {
  				if ( ($key != 'currency') && ($key != zen_session_name()) && ($key != 'x') && ($key != 'y') ) {
  				  $hidden_get_variables .= zen_draw_hidden_field($key, $value);
  				}
  			  }
  			}										
  		?><?php echo zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], ' onchange="this.form.submit();"') . $hidden_get_variables . zen_hide_session_id()?>
  		</form>		

        </td>
      </tr>
    </tbody></table>
    <div class="clear"></div>
  </div>
</div>
<div class="clear"></div>
</div> <div class="menu_t"> <div class="inner1"> <div class="inner2"> <div class="inner3"> <div class="inner4 user_menu2">
  	      <!--bof-header ezpage links-->
  			<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
  			<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
  			<?php } ?>
  			<!--eof-header ezpage links-->                              

                                    
        <div class="clear"></div>
      </div>
    </div>
  </div>
</div>
</div> <img height="8" width="1" alt="" src="includes/templates/template_default/images/pixel_trans.gif"> <br> <!--bof-optional categories tabs navigation display--> <?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?> <!--eof-optional categories tabs navigation display--> <?php } ?>
12 May 2011, 4:17 PM
#19
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Is it possible to have different images for different languages??

The TM template hard-codes /your_template/images/logo.gif as the only possible logo image.```

<!--bof-header logo and navigation display--> <?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?> <div class="header_t"> <div class="col1"><img height="41" width="1" alt="" src="includes/templates/template_default/images/pixel_trans.gif"><br> <a href="<?php echo zen_href_link(FILENAME_DEFAULT);?>"><?php echo zen_image(DIR_WS_TEMPLATE.'images/logo.gif'); ?></a> ```Stock v1.3.9h tpl_header.php uses HEADER_LOGO_IMAGE which is defined in a language file:``` <!--bof-branding display--> <div id="logoWrapper"> <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div> ```
12 May 2011, 11:32 PM
#20
alepia avatar

alepia

Zen Follower

Join Date:
Dec 2008
Posts:
158
Plugin Contributions:
0

Re: Is it possible to have different images for different languages??

Shall I just change my tpl header with the 1.3.9h one?