Zen Cart Logo
Forums / Addon Sideboxes / Getting the language name with PHP

Getting the language name with PHP

Views: 1,111

Results 1 to 1 of 1
12 Apr 2011, 3:30 PM
#1
sacauntos avatar

sacauntos

New Zenner

Join Date:
Apr 2011
Posts:
4
Plugin Contributions:
0

Getting the language name with PHP

Hello all,

I'm not sure if this is the right forum to post this question -- if not, would the admins please move it where appropiate?

I'm trying to hack the tpl_languages.php file so that it will show a list of language names, instead of flags. Sofar I have this code:

<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 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_languages.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
  $content = "";
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';

  $lng_cnt = 0;
  while (list($key, $value) = each($lng->catalog_languages)) {
    $content .= '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' .$key . '</a>  ';

    $lng_cnt ++;
    if ($lng_cnt >= MAX_LANGUAGE_FLAGS_COLUMNS) {
      $lng_cnt = 0;
      $content .= '<br />';
    }
  }
$content .= '</div>';
?>

That shows the language codes (en, es, pt, etc) but not the language names. I'm at a loss as to what should I write instead of ```php
(...) .$key . '</a>


I haven't found anywhere a Zencart PHP reference, a listing of how to retrieve these sort of things. Can anyone help?