We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28215
    • 4,149 Posts
    We’ve just recently committed some major Lexicon changes into SVN for MODx Revolution 2.0.0. We thought it appropriate to address questions relating to those changes here.

    First off, you might ask, "Why such a big change so late in the game?" Well, for one, we didnt realize the limitations of the RC1 lexicon system, and how it hampered Extras development and prevented us from having a stable multi-lingual distribution. So, what we did is:


    • Dropped entirely the modLexiconTopic and modLexiconLanguage tables.
    • Changed the ’topic’ field on modLexiconEntry to be a varchar of the topic name.
    • Refactored the entire modLexiconEntry logic so that now DB records of modLexiconEntry are *only* for overridden entries. Otherwise, they are cached from the lexicon topic files (the .inc.php files.)
    • Redid the entire Lexicon Management section to now be a grid that only allows overriding of Entries. In other words, you can only edit existing entries, and when you edit them, they show up in green, signifying they have been overridden.

    There are some real benefits to the new approach:


    • Much, much easier translation abilities.
    • Much faster lexicon loading time, since its file and array based rather than DB and Object based.
    • You can now successfully change any core lexicon entry without harming your upgrade path.
    • Cuts down on the size of the core.transport.zip and massively decreases build and setup times.
    • Much easier development. Just put a ’lexicon/’ directory in your root of your Namespace’s path (like most current Extras do) and build it in this format: ’lexicon/[language]/[topic].inc.php’. MODx will automatically parse that directory and browse it in Lexicon Management for you. You no longer need to ’buildLexicon’ in your Extra’s build scripts. However, this means that all packages using lexicons will need to be rebuilt for RC-2. All that needs to be changed is that they no longer need to call ’modPackageBuilder::buildLexicon’ in their build scripts, and their lexicon directories must be under the namespace path with the directory name ’lexicon’ (similar to this component). We apologize for the inconvience, but we promise that you’ll find the change much, much easier to develop in.

    This also means that we will be packaging in core translations into SVN. All core translations will be committed there, similar to Evolution.

    Thanks again, and feel free to ask any more questions.
      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • 14883 ☆ A M B ☆
      • 450 Posts
      Up until the end of last week I had been working with a RC-1 installation, using the Lexicon tools to add and modify lexicon entries for a customized registration form. We moved the site to RC-3 today, and I was startled to find the Lexicon Topics and Languages tabs missing.

      So it looks like the new method for adding/editing lexicon entries (to the Login/Register snippet, for the purposes of this discussion) is to edit /core/components/login/lexicon/en/register.inc.php by hand? This seems a lot less user friendly from my perspective - the end user who wants to customize a snippet.

      Or is part of the purpose of the change to discourage such post-installation customizations? (Or is that just an unfortunate--and hopefully temporary--side effect of the paradigm shift)?

        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: jrotering at Jul 12, 2010, 11:51 PM

        So it looks like the new method for adding/editing lexicon entries (to the Login/Register snippet, for the purposes of this discussion) is to edit /core/components/login/lexicon/en/register.inc.php by hand? This seems a lot less user friendly from my perspective - the end user who wants to customize a snippet.

        Or is part of the purpose of the change to discourage such post-installation customizations? (Or is that just an unfortunate--and hopefully temporary--side effect of the paradigm shift)?
        I don’t know about the Login/Register snippet specifically, but the intention is to isolate the customizations to the database via Lexicon Management, and leave all of the defaults in the files. I think this is just a side effect of the paradigm shift indeed.
          • 28215
          • 4,149 Posts
          Quote from: jrotering at Jul 12, 2010, 11:51 PM

          So it looks like the new method for adding/editing lexicon entries (to the Login/Register snippet, for the purposes of this discussion) is to edit /core/components/login/lexicon/en/register.inc.php by hand? This seems a lot less user friendly from my perspective - the end user who wants to customize a snippet.
          Oh, definitely not. You still edit them in the Lexicon Management grid - but now you can just straight override them, and it wont break your upgrade path.


          Or is part of the purpose of the change to discourage such post-installation customizations? (Or is that just an unfortunate--and hopefully temporary--side effect of the paradigm shift)?

          Definitely a side effect. I thought we had upgrades from RC-1 working, but apparently you caught a snafu. There wont be any further breaking changes in this regard.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 14883 ☆ A M B ☆
            • 450 Posts
            Oh, definitely not. You still edit them in the Lexicon Management grid - but now you can just straight override them, and it wont break your upgrade path.

            I can edit existing ones, but what about creating new ones? With Register, for example, I needed some additional profile fields on my registration form, so I added them to the form and added lexicon entries under the register topic (since that’s how all the other labels in the form were done). There’s no way to add new entries, as far as I can tell, other than directly editing the php file. Which seems for sure like it would break on upgrade, right?

            FWIW I don’t think there is any issue with the RC-1 to RC-3 upgrade - at least not related to lexicon. It seems to look/behave the same on my RC2-RC3 and on my clean/new RC3 installs. I think maybe I misdirected you by suggesting that I couldn’t edit entries... I was mainly focused on the fact that I couldn’t add new ones.

              • 28215
              • 4,149 Posts
              Ah, hrm, the New entry toolbar item seems to have gone missing. We’ll address this before PL.

              Edit: Committed to SVN. Will be in PL.
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com