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.