Skip to content

Fix missing lexicon entries#16960

Open
Jako wants to merge 35 commits into
modxcms:3.xfrom
Jako:missing-lexicon-entries
Open

Fix missing lexicon entries#16960
Jako wants to merge 35 commits into
modxcms:3.xfrom
Jako:missing-lexicon-entries

Conversation

@Jako

@Jako Jako commented May 29, 2026

Copy link
Copy Markdown
Contributor

What changed and why

Add missing lexicon entries and rename keys to use existing lexicon entries

Related issue(s)/PR(s)

#16955

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.68%. Comparing base (5a484de) to head (99055f4).
⚠️ Report is 8 commits behind head on 3.x.

Files with missing lines Patch % Lines
...Revolution/Processors/Browser/Directory/Rename.php 0.00% 1 Missing ⚠️
.../src/Revolution/Processors/Browser/File/Rename.php 0.00% 1 Missing ⚠️
...c/Revolution/Processors/Element/GetListByClass.php 0.00% 1 Missing ⚠️
...curity/Access/UserGroup/AccessNamespace/Create.php 0.00% 1 Missing ⚠️
...curity/Access/UserGroup/AccessNamespace/Update.php 0.00% 1 Missing ⚠️
...sors/Security/Access/UserGroup/Category/Create.php 0.00% 1 Missing ⚠️
...sors/Security/Access/UserGroup/Category/Update.php 0.00% 1 Missing ⚠️
...ssors/Security/Access/UserGroup/Context/Create.php 0.00% 1 Missing ⚠️
...ssors/Security/Access/UserGroup/Context/Update.php 0.00% 1 Missing ⚠️
...Security/Access/UserGroup/ResourceGroup/Create.php 0.00% 1 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff            @@
##                3.x   #16960   +/-   ##
=========================================
  Coverage     21.67%   21.68%           
- Complexity    10786    10787    +1     
=========================================
  Files           566      566           
  Lines         33149    33156    +7     
=========================================
+ Hits           7186     7189    +3     
- Misses        25963    25967    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Jako Jako force-pushed the missing-lexicon-entries branch from f79e396 to 4ccc702 Compare May 31, 2026 13:06
@Jako Jako marked this pull request as ready for review May 31, 2026 18:20
@Jako Jako requested review from Mark-H and opengeek as code owners May 31, 2026 18:20

@smg6511 smg6511 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thomas: Thanks for putting this together—I promise I'm not trying to be a PITA, but after going through this very carefully I do have a bunch of requests. Most are easily applied, but there are a couple which would need a change to files not currently in this PR.

$_lang['context'] = 'Context';
$_lang['context_add'] = 'Add Context';
$_lang['context_data'] = 'Context Data';
$_lang['context_duplicate_confirm'] = 'Are you sure you want to duplicate this context?';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entry appears to be a legacy one—there is no confirmation dialog when duplicating a Context. The controller (context.view.php) and view in which this key was found (manager/assets/modext/sections/context/view.js) also look to be unused and should be removed as there's no such view in 3.x.

Suggested change
$_lang['context_duplicate_confirm'] = 'Are you sure you want to duplicate this context?';

$_lang['user_male'] = 'Male';
$_lang['user_management_msg'] = 'Here you can choose which user you wish to edit.';
$_lang['user_mobile'] = 'Mobile phone number';
$_lang['user_new'] = 'Create User';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already exists via the key new_user; so, update the key in widgets/security/modx.panel.user.js to match.

Suggested change
$_lang['user_new'] = 'Create User';

$_lang['add_tv'] = 'Create TV';
$_lang['add_weblink'] = 'Create Weblink';
$_lang['add_symlink'] = 'Create Symlink';
$_lang['alert'] = 'Alert';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It certainly doesn't hurt to have this but, from what I found, there are nuances in three places where this key is used:

  • downloadFile method in modx.tree.directory.js and modx.browser.js. Of note here is that the MODx.msg.alert call seems to be overridden by something and is not actually used, although the presence of the failure listener is required, even if its declared like so: failure: { fn: Ext.emptyFn }
  • processResponse in modx.tree.treeloader.js where the msg.alert is actually used. Here however, "Error" or "Warning" is probably the better dialog title rather than "Alert," in which case we should change the key, i.e.: MODx.msg.alert(_('error'), json.message);

$_lang['backup'] = 'Backup';
$_lang['bk_manager'] = 'Backup';
$_lang['bulk_actions'] = 'Bulk Actions';
$_lang['cache_err_write'] = 'Cannot cache the file to download!';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class this is called in is specific to the Console, so we should be more clear about that. Further we should change the key to be more clear as well (e.g., console_download_cache_err

Suggested change
$_lang['cache_err_write'] = 'Cannot cache the file to download!';
$_lang['console_download_cache_err'] = 'Could not download the file due to a problem caching the Console’s content for output!';

Note that there are two additional todos to complete this fix:

  1. Change the key in Processors/System/DownloadOutput.php from cache_err_write to console_download_cache_err
  2. Add an empty failure to the modx.console.js file, i.e., add the following to the download method's listeners: failure: { fn: Ext.emptyFn },; otherwise the failure message that this Lex is used in never gets shown.

$_lang['category_remove'] = 'Delete Category';
$_lang['chunk'] = 'Chunk';
$_lang['chunks'] = 'Chunks';
$_lang['class_err_ns'] = 'Class not specified.';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that this was the original key, but it is exclusively used in relation to Derivatives (in the current codebase) so a more specific key and message would be better:

Suggested change
$_lang['class_err_ns'] = 'Class not specified.';
$_lang['derivatives_parent_class_err_empty'] = 'Can not get this object’s child classes because its class was not specified.';

Again, a couple changes would be needed to the calling class (System/Derviatives/GetList.php) at ~L49:

  1. Change the Lex key, and
  2. Add a return to the statement

So, return $this->failure($this->modx->lexicon('derivatives_parent_class_err_empty'));

Without the return, the error will never show in the front end.

$_lang['user_password_email'] = '<h2>Set up your password</h2><p>We received a request to set up your MODX Revolution password. You can set up your password by clicking the button below and following the instructions on screen.</p><p class="center"><a href="[[+url_scheme]][[+http_host]][[+manager_url]]?modhash=[[+hash]]" class="btn">Set up my password</a></p><p class="small">If you did not send this request, please ignore this email.</p>';

// Aliases
$_lang['user_group_user_create'] = $_lang['user_group_user_add'];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding a couple aliases for re-keyed items...

Suggested change
$_lang['user_group_user_create'] = $_lang['user_group_user_add'];
$_lang['user_err_nf'] = $_lang['user_err_not_found'];
$_lang['user_profile_err_nf'] = $_lang['user_profile_err_not_found'];

$this->user = $this->modx->user;
if (!$this->user) {
return $this->modx->lexicon('user_err_not_found');
return $this->modx->lexicon('user_err_nf');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep this as it was, but re-key as suggested in the Lex file:

Suggested change
return $this->modx->lexicon('user_err_nf');
return $this->modx->lexicon('user_err_not_found');

Note that the alias I added in the Lex suggestion would cover any existing usage of the old key, but we could also update the key in the other two places it's found: the security/profile.class.php and security/user/update.class.php (below) controllers

$this->profile = $this->modx->user->getOne('Profile');
if ($this->profile === null) {
return $this->modx->lexicon('user_profile_err_not_found');
return $this->modx->lexicon('user_profile_err_nf');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, let's keep the newer key style, and re-key the Lex entry

Suggested change
return $this->modx->lexicon('user_profile_err_nf');
return $this->modx->lexicon('user_profile_err_not_found');

$_lang['user_photo_message'] = 'Enter the image URL for this user or use the insert button to select or upload an image file on the server.';
$_lang['user_prevlogin'] = 'Previous Login';
$_lang['user_prevlogin_desc'] = 'The previous time that the user successfully logged in.';
$_lang['user_profile_err_nf'] = 'FATAL ERROR: User profile not found.';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-key to match the Profile/Update processor. While we're doing so, no need for the error type in the message

Suggested change
$_lang['user_profile_err_not_found'] = 'User profile not found.';

$name = $this->getProperty('name');
if (empty($name)) {
$this->addFieldError('name', $this->modx->lexicon('namespace_err_ns_name'));
$this->addFieldError('name', $this->modx->lexicon($this->objectType . '_err_ns'));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exclusive to one object, so no use for dynamic Lex key IMO

Suggested change
$this->addFieldError('name', $this->modx->lexicon($this->objectType . '_err_ns'));
$this->addFieldError('name', $this->modx->lexicon('namespace_err_ns'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants