Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,693
    Plugin Contributions
    9

    Default question on new style language files.......

    i am looking at the docs page. and specifically, the part of the page that says this:

    Example:

    If both

    ./includes/languages/english/lang.order_status.php
    ./includes/languages/english/order_status.php

    exist, the second one (the older style define based file) is ignored.

    my question is what if there are these 2 files:

    ./includes/languages/english/lang.order_status.php
    ./includes/languages/english/MY_TEMPLATE/order_status.php

    which file should be ignored? and which one is ignored?

    it seems that all template override language files must now use the new style; despite the file being an override.

    or am i wrong here?

    thanks.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

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

    Default Re: question on new style language files.......

    Don't use old style language files for overriding core files. Old style language support is only meant for allowing older plugins (with their own unique language files that don't override anything) to work until they are updated.

    > it seems that all template override language files must now use the new style; despite the file being an override.

    Correct.
    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
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,703
    Plugin Contributions
    123

    Default Re: question on new style language files.......

    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.

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

    Default Re: question on new style language files.......

    ...to work until they are updated.
    Personally I prefer that plugins use "old-style", keeps the core files in a single block for easy comparison at a glance with whatever/Github core instead of all mixed-in.
    Just my archaic working practice, of course.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

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

    Default Re: question on new style language files.......

    > Personally I prefer that plugins use "old-style"

    This is a fine way to go as long as all definitions the plugin creates are completely unique. Otherwise you get duplicate definition logs in PHP 8.
    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
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,703
    Plugin Contributions
    123

    Default Re: question on new style language files.......

    The root cause of the original issue as reported by OP is that there never was a file called 'order_status.php'. The file 'lang.order_status.php' is a new file created in Zen Cart 1.5.8+. So there are no auto-loaders looking for this file that would do the fallback to older file names (because there's no page called "order_status").

    This file is explicitly loaded using the new `filenames.php` define FILENAME_ORDER_STATUS.
    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.

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,693
    Plugin Contributions
    9

    Default Re: question on new style language files.......

    Quote Originally Posted by swguy View Post
    The root cause of the original issue as reported by OP is that there never was a file called 'order_status.php'. The file 'lang.order_status.php' is a new file created in Zen Cart 1.5.8+. So there are no auto-loaders looking for this file that would do the fallback to older file names (because there's no page called "order_status").

    This file is explicitly loaded using the new `filenames.php` define FILENAME_ORDER_STATUS.
    this is completely untrue.

    change the filename to contact_us.php and the behavior is the same.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

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

    Default Re: question on new style language files.......

    If you create an old style contact_us.php file as an override

    ./includes/languages/english/YOUR_TEMPLATE/contact_us.php

    you will get a boatload of errors. That's why it's not recommended.

    I have explained how it works to you. I get that there are better ways, but I have no appetite for doing a ton of work so people can continue to use an old format language file when using a new one takes seconds.
    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.

  9. #9
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,693
    Plugin Contributions
    9

    Default Re: question on new style language files.......

    Quote Originally Posted by swguy View Post
    If you create an old style contact_us.php file as an override

    ./includes/languages/english/YOUR_TEMPLATE/contact_us.php

    you will get a boatload of errors. That's why it's not recommended.

    I have explained how it works to you. I get that there are better ways, but I have no appetite for doing a ton of work so people can continue to use an old format language file when using a new one takes seconds.
    actually, you have confirmed what i already found out.

    i am NOT advocating for people to use the old language format.

    i am only posting for those attempting an upgrade and see that their language overrides no longer work.

    doing an upgrade on a mature site, and then seeing "TagLine Here" seems a bit off putting.

    and the documentation is not clear as to why that would be.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

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

    Default Re: question on new style language files.......

    > and the documentation is not clear as to why that would be.

    https://docs.zen-cart.com/user/upgra...onsiderations/

    Under 1.5.8/1.5.8a:

    Language files were changed to a new format. See Developer Information on Array based Language files for more details. If you are upgrading, you may wish to consider doing only the basic language file customizations rather than port all the changes you had from prior releases. Core language files must be overridden in the new format to prevent PHP Warnings; plugin language files may use the old or the new file format.
    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.

 

 

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