Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008
    Location
    Qld, Australia
    Posts
    309
    Plugin Contributions
    6

    Default Language files -checking existence and loading

    zc158 - this is not a bug so if inappropriate please move to a more convenient discussion location.

    With zc158 I am trying to understand about loading language files to enable the:
    . payment plugin SecurePayXML
    . shipping plugin AuPost
    . ot-total module paymentmoduelfee
    . to work better with PHP8.2 and edit orders and still operate with zc157d.

    In admin/modules.php
    at approx line 182 the $languageLoader->hasLanguageFile is called and passes
    (DIR_FS_CATALOG . DIR_WS_LANGUAGES, $_SESSION['language'], $file, '/modules/' . $module_type)

    $module_type does not require the folder slash "/" on the end as this is added in the public function hasLanguageFile in /includes/classes/ResourceLoaders/LanguageLoader.php

    This function looks for the pre zc158 language file first and if it exists returns true
    else it looks for the zc158 lang.language file and if it exists returns true

    When control is passed back to admin/modules.php
    the $languageLoader->loadExtraLanguageFiles(DIR_FS_CATALOG . DIR_WS_LANGUAGES, $_SESSION['language'], $file, '/modules/' . $module_type);
    is called in /includes/classes/ResourceLoaders/LangaugeLoader.php

    The public function loadExtraLanguageFiles calls the arrayLoader
    $this->arrayLoader->loadExtraLanguageFiles($rootPath, $language, $fileName, $extraPath);
    with the original $extrapath but does not append the folder slash "/" nor does it look for the zc158 lang.language file.

    I'm looking for assistance to understand how this is supposed to work.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,291
    Plugin Contributions
    125

    Default Re: Language files -checking existence and loading

    If you think you have found a bug, would you please express it at a higher level and provide reproduction steps?

    For example, is there an issue when running the plugin Payment Module Fee that you're unsure how to solve? If so, please post the log and the steps for producing it.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,798
    Plugin Contributions
    17

    Default Re: Language files -checking existence and loading

    Quote Originally Posted by OldNGrey View Post
    zc158 - this is not a bug so if inappropriate please move to a more convenient discussion location.

    With zc158 I am trying to understand about loading language files to enable the:
    . payment plugin SecurePayXML
    . shipping plugin AuPost
    . ot-total module paymentmoduelfee
    . to work better with PHP8.2 and edit orders and still operate with zc157d.

    In admin/modules.php
    at approx line 182 the $languageLoader->hasLanguageFile is called and passes
    (DIR_FS_CATALOG . DIR_WS_LANGUAGES, $_SESSION['language'], $file, '/modules/' . $module_type)

    $module_type does not require the folder slash "/" on the end as this is added in the public function hasLanguageFile in /includes/classes/ResourceLoaders/LanguageLoader.php

    This function looks for the pre zc158 language file first and if it exists returns true
    else it looks for the zc158 lang.language file and if it exists returns true

    When control is passed back to admin/modules.php
    the $languageLoader->loadExtraLanguageFiles(DIR_FS_CATALOG . DIR_WS_LANGUAGES, $_SESSION['language'], $file, '/modules/' . $module_type);
    is called in /includes/classes/ResourceLoaders/LangaugeLoader.php

    The public function loadExtraLanguageFiles calls the arrayLoader
    $this->arrayLoader->loadExtraLanguageFiles($rootPath, $language, $fileName, $extraPath);
    with the original $extrapath but does not append the folder slash "/" nor does it look for the zc158 lang.language file.

    I'm looking for assistance to understand how this is supposed to work.
    May i suggest looking at this document link about loading language files when trying to support 1.5.8 along with previous versions: https://docs.zen-cart.com/dev/code/1...-language-file

    Does that guidance resolve your concerns and difficulties?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Apr 2008
    Location
    Qld, Australia
    Posts
    309
    Plugin Contributions
    6

    Default Re: Language files -checking existence and loading

    I have read the documentation.

    My main problem has been trying to make plugins work with both zc157 and zc158 and having constants not being defined before initial loading of the data.
    I'll probably just produce separate versions.

  5. #5
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,761
    Plugin Contributions
    30

    Default Re: Language files -checking existence and loading

    I decided that it was a neater solution (visually, when comparing filesets of zencarts and plugins), to leave plugins/add-on code using the old language file format.
    It keeps core and add-on visually separate and still works. Much effort has gone into making the two methods work together and that's not going anywhere anytime soon.

    Name:  file comparison.jpg
Views: 149
Size:  19.1 KB
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

 

 

Similar Threads

  1. v157 language loading question....
    By carlwhat in forum General Questions
    Replies: 3
    Last Post: 8 Oct 2021, 08:30 PM
  2. CSS files are loading twice,normal and minimized,how to solve?
    By Rimo in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 27 Mar 2011, 11:55 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