Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Load extra language files in admin

    So, I'm rewriting one of the older plugins and am trying to load an extra language file in the plugin's admin page, but seem to be missing something. I can't seem to find a function for it for loading custom files so I tried the approach that works in frontend.
    In the admin page, right after the application_top.php line, I've added:
    Code:
    $languageLoader->loadDefinesFromFile(__DIR__.'/'.DIR_WS_LANGUAGES, $_SESSION['language'], 'mail.php');
    The loadDefinesFromArrayFile() does trigger and it's pointing to the correct file (/path/to/admin/includes/languages/english/lang.mail.php), but I'm guessing it's failing because it's an admin file and is failing on line 50 of LanguageLoader.php because of the path it's pointing to catalog and not admin:
    Code:
    $this->fileLoader->loadFileDefineFile(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $language . $baseDirectory . '/' . $languageFile);
    Any pointers would be appreciated. I'm trying to avoid putting the definitions from the original file into this page's lang file. TIA

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,696
    Plugin Contributions
    123

    Default Re: Load extra language files in admin

    That Software Guy. My Store: Zen Cart Modifications
    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
    Nov 2005
    Location
    los angeles
    Posts
    2,691
    Plugin Contributions
    9

    Default Re: Load extra language files in admin

    Quote Originally Posted by balihr View Post
    So, I'm rewriting one of the older plugins and am trying to load an extra language file in the plugin's admin page, but seem to be missing something. I can't seem to find a function for it for loading custom files so I tried the approach that works in frontend.
    In the admin page, right after the application_top.php line, I've added:
    Code:
    $languageLoader->loadDefinesFromFile(__DIR__.'/'.DIR_WS_LANGUAGES, $_SESSION['language'], 'mail.php');
    ... TIA
    hav you tried:

    PHP Code:
    //from
    $languageLoader->loadDefinesFromFile(__DIR__.'/'.DIR_WS_LANGUAGES$_SESSION['language'], 'mail.php');

    //to
    $languageLoader->loadExtraLanguageFiles(__DIR__.'/'.DIR_WS_LANGUAGES$_SESSION['language'], 'mail.php'); 
    YWIA.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  4. #4
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Load extra language files in admin



    I'm not sure what pis**s me off more - the fact that I was completely oblivious of the loadExtraLanguageFiles method or the fact that I actually was searching through the docs and didn't find the section that explains it... I did go straight to Languages, tho, instead of Code, but still...

    And if that wasn't enough, I started rewriting RCS to update it for 1.5.8...

    Thanks for the info, guys!

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,696
    Plugin Contributions
    123

    Default Re: Load extra language files in admin

    > And if that wasn't enough, I started rewriting RCS to update it for 1.5.8...

    Thanks for doing this!
    That Software Guy. My Store: Zen Cart Modifications
    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.

  6. #6
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Load extra language files in admin

    Quote Originally Posted by swguy View Post
    > And if that wasn't enough, I started rewriting RCS to update it for 1.5.8...

    Thanks for doing this!
    LOL, that's the point - I'm not doing it, it's already been updated, but I didn't know that either...

 

 

Similar Threads

  1. Replies: 1
    Last Post: 14 Apr 2012, 07:57 PM
  2. Don't load non-php files in admin autoloader
    By swguy in forum Bug Reports
    Replies: 0
    Last Post: 6 Dec 2010, 02:27 AM
  3. order emails to admin language/config files
    By JimmyV in forum General Questions
    Replies: 4
    Last Post: 14 Jul 2010, 06:07 PM
  4. Modifying the admin language files
    By m_young in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 11 Sep 2009, 01:17 AM

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