Missing Language Constants

Fixing a missing language define in translated language packs

NOTE: These instructions are for Zen Cart 1.5.8 and above.

If you are running under PHP 8.0 or higher, a missing language definition will cause a blank screen. This is a particular risk for translated language packs, which might not be up to date with the latest Zen Cart version, but it can also happen for plugins with out of date or incomplete language files.

The debug log will start with a message like this:

[04-Aug-2023 11:50:03 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "SOME_CONSTANT" in /Users/scott/Sites/gh_demo_200/...

To fix this issue, follow these steps:

  • Locate the language constant in English, looking first in includes/languages/lang.english.php, then under includes/languages/english.
  • When you have found the English language definition, update the file in the version for YOURLANGUAGE to add the definition. For example:
    • If the definition is in includes/languages/lang.english.php, update includes/languages/lang.YOURLANGUAGE.php
    • If the definition is in includes/languages/english/lang.index.php, update includes/languages/YOURLANGUAGE/lang.index.php

Language File Help:




Still have questions? Use the Search box in the upper right, or try the full list of FAQs. If you can't find it there, head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified August 23, 2024 by Scott C Wilson (2c7c41e8).