Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2006
    Location
    Chicago, IL
    Posts
    149
    Plugin Contributions
    1

    Default 1.3.6. Directory Change/ Language Modification

    I have installed Zen Cart locally. I installed the Italian language pack successfully. I have tested it an it works great. However, there are areas in my custom template I need to change.

    One of these areas is the tpl_footer.php file. I am just learning Zen Cart's directory structure for customizing templates. However, I'm stuck in modifying the tpl_footer.php file into Italian. I will install more than just Italian so this file should be set up so that I can modify it for each language.

    In seaching the archives I came across this fix:
    In searching for my answer I found this thread: http://www.zen-cart.com/forum/showth...plate+language

    This is my answer, however, the structure has changed for 1.3.6. Under includes/modules/ there is no tpl_header.php or tpl_header.php file.

    Please point me to the updated directory for the 1.3.6 version and where I should place the tpl_footer_italian.php file. Additionally, I will change other template files so explaining the new structure as it applies to this request would be great.

    Thank you.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: 1.3.6. Directory Change/ Language Modification

    One of these areas is the tpl_footer.php file.
    You are looking in the wrong location...

    These tpl_ files are in your_template file structure and originals are located in the /includes/templates/template_default/common and /templates folders that you will copy the relavant files to /includes/templates/your_template/common and /templates folders
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Dec 2006
    Location
    Chicago, IL
    Posts
    149
    Plugin Contributions
    1

    Default Re: 1.3.6. Directory Change/ Language Modification

    Thanks for your assistance Kobra. However, I know which directory the tpl files are under.

    Let me explain myself a bit more. I have a custom template I created. This template has a footer. In the footer are hyperlink descriptions in English. I will create a site that will have multiple languages. I have installed the first language pack, Italian. I have tested it and it works fantastic.

    However, on my custom footer after the choice of Italian language is selected I still see English hyperlink descriptions in the footer. I need this to be changed to Italian. From this archive: http://www.zen-cart.com/forum/showth...plate+language I realize that I need to create footers and headers (for example) for every language I create. This means, if I have Italian and Russian installed and want the footer and header to be different I have to change each file to tpl_footer_russian.php, etc. I understand this completely.

    Here is where 1.3.6 changes from what is in the archive. Let me actually paste the post here so no one has to go and look at the post:

    Code:
     If you want to have completely different headers for each language, you could try this:
    make a different tpl_header.php file for each language and save them as tpl_header_english.php, tpl_header_spanish.php etc
    Then in includes/modules/header.php, change this line at the end     
    
    Code:
          *require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php'); 
    
    to     
    Code:
    *require($template->get_template_dir('tpl_header_' . $_SESSION['language'] . '.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header_' . $_SESSION['language'] . '.php');
    Here is where the directory structure changes in 1.3.6: includes/modules/header.php NO SUCH ANIMAL. Only footer.php exists and there is no require statement in that file.

    This is where I am getting stuck. Instead I modified the require statement in tpl_main_page.php file under the common directory and created tpl_footer_italian.php. I got a parsing error.

    I need each footer and header to be unique for every language. These directions in the archived forum disscussions are outdated. Does anyone know what the current modification is to this customization?

    Thank you.

    I hope my post is more understandable.

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 1.3.6. Directory Change/ Language Modification

    Quote Originally Posted by Rabbcon View Post
    I realize that I need to create footers and headers (for example) for every language I create. This means, if I have Italian and Russian installed and want the footer and header to be different I have to change each file to tpl_footer_russian.php, etc. I understand this completely.
    This would only be the case if you wanted the header and footer to function differently for each language. If you want them to function in the same way, but in Italian and Russian then you only need ensure that your language files are complete (many of the language packs aren't).

    If you could be more specific about the changes that you want to make to the header and footer (ideally with a link to the current state of your site), it would be easier to help you.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 1.3.6. Directory Change/ Language Modification

    A quick addition ... if your design really does need differently structured headers and footers for each language, then the file that calls them is common/tpl_main_page.php.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  6. #6
    Join Date
    Dec 2006
    Location
    Chicago, IL
    Posts
    149
    Plugin Contributions
    1

    Default Re: 1.3.6. Directory Change/ Language Modification

    Thank you. The headers and the footers will not function differently for each language.

    My site is local so unfortunately there is not link I can supply. However, I will give you a detailed example:

    ENGLISH FOOTER
    Privacy Notice (a hyperlink)

    FRENCH FOOTER
    Notification d'intimité (a hyperlink)


    ITALIAN FOOTER
    Avviso di segretezza (a hyperlink)

    SPANISH FOOTER
    Aviso de la aislamiento

    GERMAN FOOTER
    Privatlebennachricht (a hyperlink)

    Each hyperlink that is in the default language of English in my footer and header should change into the corresponding language the user selects. So, when the user opens my site they will see everything in English. They will go to the header and select their language from the CHOOSE LANGUAGE drop down or flag. Once that flag is selected they will then see the page will change into their selected language. This is happening except for the header and the footer. Can you tell me exactly how this change should be made?

    Thank you.

  7. #7
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: 1.3.6. Directory Change/ Language Modification

    In the /includes/languages - you should have english.php, french.php, german.php, italian.php, & spanish.php

    You then also need folders:
    /includes/languages/english
    /includes/languages/french
    /includes/languages/german
    /includes/languages/italian
    /includes/languages/spanish

    and in these folders, respectively, any files that have been translated i.e.
    header.php
    create_account.php
    and so on

    along with language specific custom template folders & contents

    If you have a custom template folder in /includes/english/my_template
    You need this replicated for each language
    Zen-Venom Get Bitten

  8. #8
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 1.3.6. Directory Change/ Language Modification

    Ah. A good example. For most text and links in the header and footer you would simply find the English text in the header in the form (for example) HEADER_TITLE_MY_ACCOUNT has define statements in the header.php file for each language define('HEADER_TITLE_MY_ACCOUNT','My Account'); in languages/english/YOUR_TEMPLATE_NAME/header.php and define('HEADER_TITLE_MY_ACCOUNT','Mon Compte'); in languages/french/YOUR_TEMPLATE_NAME/header.php, etc.

    Zen Cart will then detect the language that your visitor has chosen and use the appropriate language file.

    HOWEVER ... your example is taken from a link generated by Zen Cart's EZ-Pages. These have unfortunately been implemented mono-lingually. But there is an extension available in the downloads section that makes them multi-lingual. You can find it here.
    Last edited by kuroi; 27 Dec 2006 at 07:34 PM.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  9. #9
    Join Date
    Dec 2006
    Location
    Chicago, IL
    Posts
    149
    Plugin Contributions
    1

    Default Re: 1.3.6. Directory Change/ Language Modification

    Thank you for explaining this to me and pointing me in the correct direction for the fix.

  10. #10
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: 1.3.6. Directory Change/ Language Modification

    Glad to be of help. This is important to get right from the beginning when you're building a multi-lingual site. You might find this wiki entry helpful as well.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 

Similar Threads

  1. header language modification
    By tony_sar in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 16 Jun 2011, 08:31 PM
  2. Need Portugues language modification
    By tipster in forum Addon Language Packs
    Replies: 2
    Last Post: 8 Apr 2009, 05:51 PM
  3. [not a bug] Language directory error
    By GwaiTsi in forum Addon Language Packs
    Replies: 5
    Last Post: 20 Feb 2007, 10:26 AM

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