Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    red flag Change SChinese to Chinese

    [Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

    Hi all,

    SChinese there
    http://www.mammyloves.com/store/inde...ex&language=gb
    While on this language, the top menu dropdown language bar show Schinese
    Which PHP or language files that I need to change to make it from SChinese to Chinese?

    English there
    http://www.mammyloves.com/store/inde...ex&language=en
    While on English language, the same language dropdown menu can show Chinese (Before it is Schinese)
    I go to back end
    Localization > Languages > edit
    Name: chinese
    Code: gb
    Image: icon.gif
    Directory: schinese
    Sort Order: 3

    Before the name on above setting are
    Name: Schinese, I change it to chinese ....
    So English language look like work, but .... why it look like not work on Chinese language?


    Sorry of my poor English ..

  2. #2
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: Change SChinese to Chinese

    Based on that test, it appears that your language selector (which appears to be javascript code) is using the directory field from TABLE_LANGUAGES instead of the name field. The proper solution would be to modify how that code works such that it uses the name field.

    The alternative, which will cause issues/trouble in the future is to create the language directories that are named Chinese instead of schinese and copy every file/folder over to that location.

    There are a few ways to get down to the issue, but the admin tool called developers tool kit should help to find the code area in question. (admin->tools->developers tool kit)

    You may want to try starting with the lower left corner, enter directory, in the dropdown choose catalog, in the next dropdown select javascript, then search.

    Otherwise, again using the lower left corner could enter information that is found adjacent/around the source code shown for the dropdown such as: select-language and search everything. That should/would identify where either the javascript takes action or the dropdown is drawn and from there follow "backwards" where the list of items comes from.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default Re: Change SChinese to Chinese

    Hi mc12345678,

    While using Developer Tool for search all file

    Only locked "/includes/templates/##########_temp/sideboxes/tpl_languages_header.php"

    PHP Code:
    <?php
    /**
     * All Business Template
     *
     * @package templateSystem
     * @copyright Copyright 2007 iChoze Internet Solutions http://ichoze.com
     * @copyright Portions 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_languages.php 2982 2006-02-07 07:56:41Z birdbrain $
     */
     
      
    $content "";
      
    $content .= '<div class="form-language"><label for="select-language"></label>';
      
    $lng_cnt 0;
      
       
    $content .='<div class="select-language sbHolder" id="select-language">
       <a class="sbSelector" href="javascript:void(0)">'
    .ucfirst($_SESSION['language']).'</a>
       <a class="sbToggle" href="javascript:void(0)"></a>
       '
    ;
       
    $content .='<ul id="sbOption_language" class="sbOptions" style="display: none;"    >';
        while (list(
    $key$value) = each($lng->catalog_languages)) {
         if(
    $_SESSION['languages_code']=="$key"){
        
    $content .= '<li class="lang"> <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'],'','','class="flag"').'&nbsp;'.$value['name']. '</a></li>';
         }else{
             
    $content .= '<li class="lang"> <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'],'','','class="flag"').'&nbsp;'.$value['name']. '</a></li>';
         }
        
    $lng_cnt ++;
        
      }
       
    $content.="</ul></div>";
       
      


      
    $content .= '</div>';

     
     
    ?>

    As using the CSS class to lock
    I only find above as

    PHP Code:
    $content .='<div class="select-language sbHolder" id="select-language">
       <a class="sbSelector" href="javascript:void(0)">'
    .ucfirst($_SESSION['language']).'</a>
       <a class="sbToggle" href="javascript:void(0)"></a>
       '


    So ... Why English work, but change to Chinese not work? Look it the coding
    PHP Code:
    ucfirst($_SESSION['language']) 

  4. #4
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default Re: Change SChinese to Chinese

    Where using development tool on find all mode and search "javascript:void(0)"

    Have some result, it look like this template default installed a module called "Dynamic Filter"
    https://www.zen-cart.com/downloads.php?do=file&id=1361

    And search some files that I am thinking relationship

    /includes/templates/##########_temp/sideboxes/tpl_dynamic_filter.php
    PHP Code:
    Line #10846 :       el.href = 'javascript:void(0)'; 

    /includes/templates/##########_temp/sideboxes/tpl_languages_header.php
    PHP Code:
    Line #18 :    <a class="sbSelector" href="javascript:void(0)">'.ucfirst($_SESSION['language']).'</a>
    Line #19 :    <a class="sbToggle" href="javascript:void(0)"></a> 

  5. #5
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: Change SChinese to Chinese

    Quote Originally Posted by explorer1979 View Post
    Hi mc12345678,

    While using Developer Tool for search all file

    Only locked "/includes/templates/##########_temp/sideboxes/tpl_languages_header.php"

    PHP Code:
    <?php
    /**
     * All Business Template
     *
     * @package templateSystem
     * @copyright Copyright 2007 iChoze Internet Solutions http://ichoze.com
     * @copyright Portions 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_languages.php 2982 2006-02-07 07:56:41Z birdbrain $
     */
     
      
    $content "";
      
    $content .= '<div class="form-language"><label for="select-language"></label>';
      
    $lng_cnt 0;
      
       
    $content .='<div class="select-language sbHolder" id="select-language">
       <a class="sbSelector" href="javascript:void(0)">'
    .ucfirst($_SESSION['language']).'</a>
       <a class="sbToggle" href="javascript:void(0)"></a>
       '
    ;
       
    $content .='<ul id="sbOption_language" class="sbOptions" style="display: none;"    >';
        while (list(
    $key$value) = each($lng->catalog_languages)) {
         if(
    $_SESSION['languages_code']=="$key"){
        
    $content .= '<li class="lang"> <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'],'','','class="flag"').'&nbsp;'.$value['name']. '</a></li>';
         }else{
             
    $content .= '<li class="lang"> <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'],'','','class="flag"').'&nbsp;'.$value['name']. '</a></li>';
         }
        
    $lng_cnt ++;
        
      }
       
    $content.="</ul></div>";
       
      


      
    $content .= '</div>';

     
     
    ?>

    As using the CSS class to lock
    I only find above as

    PHP Code:
    $content .='<div class="select-language sbHolder" id="select-language">
       <a class="sbSelector" href="javascript:void(0)">'
    .ucfirst($_SESSION['language']).'</a>
       <a class="sbToggle" href="javascript:void(0)"></a>
       '


    So ... Why English work, but change to Chinese not work? Look it the coding
    PHP Code:
    ucfirst($_SESSION['language']) 
    I'm sure that your second search (second post on this portion of the topic) resulted in several files that might seem appropriate, but the above search shows the issue as originating here.

    As defined in the loaded file: includes/init_includes/init_languages.php, $_SESSION['language'] is assigned the directory name and is the session variable that is routinely used to pull language files from the correct language directory; however, the desire is to pull the 'name' key of the language that is currently in use... As it appears that $lng is currently defined, it is possible to use it in this code instead of (or in addition to having) the $_SESSION['language'] value. So from the init file there are the following assignments upon load:

    Code:
      $_SESSION['language'] = (zen_not_null($lng->language['directory']) ? $lng->language['directory'] : 'english');
      $_SESSION['languages_id'] = (zen_not_null($lng->language['id']) ? $lng->language['id'] : 1);
      $_SESSION['languages_code'] = (zen_not_null($lng->language['code']) ? $lng->language['code'] : 'en');
    In the file /includes/templates/##########_temp/sideboxes/tpl_languages_header.php (Guessing that the template's/folder name is one that has been considered by ZC to not be displayed), in this section:
    Code:
    $content .='<div class="select-language sbHolder" id="select-language">
       <a class="sbSelector" href="javascript:void(0)">'.ucfirst($_SESSION['language']).'</a>
       <a class="sbToggle" href="javascript:void(0)"></a>
       ';
    One should replace ucfirst($_SESSION['language']) with:
    Code:
    $lng->catalog_languages[$_SESSION['languages_code']]['name']
    And that will pull up the language as defined in your languages area of the admin, so as far as "capitalization" it should display exactly as entered which in your post from a few posts back this should have Chinese as entered. It's unfortunate that this hasn't been otherwise addressed, but considering most languages use a directory that has the full name of the language, it probably wasn't really noticed by many others. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default Re: Change SChinese to Chinese

    mc12345678,

    Wow, you are great and powerful.

    It work for me now

    Thank you x 1000

  7. #7
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: Change SChinese to Chinese

    Glad that worked. I'm going to make a post in the associated template thread (all business) for others, though it could be that it was addressed there already.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. gibberish at homepage in Chinese
    By jay2015 in forum General Questions
    Replies: 14
    Last Post: 20 Sep 2015, 05:48 AM
  2. Is there an sChinese language Template?
    By rachalmers in forum Addon Templates
    Replies: 4
    Last Post: 1 Jan 2010, 01:42 AM
  3. Replies: 5
    Last Post: 21 Aug 2009, 11:22 AM
  4. Chinese in forms
    By jamina1 in forum Addon Language Packs
    Replies: 1
    Last Post: 13 Jun 2008, 05:32 PM
  5. is there a pack for BOTH Traditional Chinese and Simplified Chinese
    By paulFromWales in forum Addon Language Packs
    Replies: 0
    Last Post: 11 Mar 2007, 02:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR