fixed lang error#1628
Conversation
WalkthroughThis change reorganizes language constants in the English admin modules language file, consolidating user-access message definitions. The constant Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@htdocs/modules/system/language/english/admin/modulesadmin.php`:
- Around line 136-139: The user-facing strings are inconsistent:
_AM_SYSTEM_MODULES_ACCESS_ADMIN_ADD and
_AM_SYSTEM_MODULES_ACCESS_ADMIN_ADD_ERROR use "Group ID %s" (no colon) while
_AM_SYSTEM_MODULES_ACCESS_USER_ADD and _AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR
use "Group ID: %s"; update the two user constants
(_AM_SYSTEM_MODULES_ACCESS_USER_ADD and
_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR) to use "Group ID %s" (remove the
colon) so all four messages follow the same format.
- Around line 138-139: The two new language constants
_AM_SYSTEM_MODULES_ACCESS_USER_ADD and _AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR
use "Group ID: %s" with a colon while the admin counterparts use "Group ID %s"
without a colon; update these two constants to remove the colon so they read
"Group ID %s" to keep punctuation consistent with the admin messages, and run a
quick grep for _AM_SYSTEM_MODULES_ACCESS_* to ensure all related message pairs
use the same placeholder format.
| define('_AM_SYSTEM_MODULES_ACCESS_ADMIN_ADD', 'Added admin access right for Group ID %s'); | ||
| define('_AM_SYSTEM_MODULES_ACCESS_ADMIN_ADD_ERROR', 'ERROR: Could not add admin access right for Group ID %s'); | ||
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR', 'Added user access right for Group ID: %s'); | ||
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR_ERROR', 'ERROR: Could not add user access right for Group ID: %s'); | ||
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD', 'Added user access right for Group ID: %s'); | ||
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR', 'ERROR: Could not add user access right for Group ID: %s'); |
There was a problem hiding this comment.
Inconsistent "Group ID" format between admin and user access messages.
Lines 136–137 (admin constants) format the placeholder as Group ID %s (no colon), while lines 138–139 (user constants) use Group ID: %s (with colon). Pick one and apply it consistently.
🔧 Proposed fix — align with the existing admin format (no colon)
-define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD', 'Added user access right for Group ID: %s');
-define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR', 'ERROR: Could not add user access right for Group ID: %s');
+define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD', 'Added user access right for Group ID %s');
+define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR', 'ERROR: Could not add user access right for Group ID %s');📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| define('_AM_SYSTEM_MODULES_ACCESS_ADMIN_ADD', 'Added admin access right for Group ID %s'); | |
| define('_AM_SYSTEM_MODULES_ACCESS_ADMIN_ADD_ERROR', 'ERROR: Could not add admin access right for Group ID %s'); | |
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR', 'Added user access right for Group ID: %s'); | |
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR_ERROR', 'ERROR: Could not add user access right for Group ID: %s'); | |
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD', 'Added user access right for Group ID: %s'); | |
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR', 'ERROR: Could not add user access right for Group ID: %s'); | |
| define('_AM_SYSTEM_MODULES_ACCESS_ADMIN_ADD', 'Added admin access right for Group ID %s'); | |
| define('_AM_SYSTEM_MODULES_ACCESS_ADMIN_ADD_ERROR', 'ERROR: Could not add admin access right for Group ID %s'); | |
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD', 'Added user access right for Group ID %s'); | |
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR', 'ERROR: Could not add user access right for Group ID %s'); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@htdocs/modules/system/language/english/admin/modulesadmin.php` around lines
136 - 139, The user-facing strings are inconsistent:
_AM_SYSTEM_MODULES_ACCESS_ADMIN_ADD and
_AM_SYSTEM_MODULES_ACCESS_ADMIN_ADD_ERROR use "Group ID %s" (no colon) while
_AM_SYSTEM_MODULES_ACCESS_USER_ADD and _AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR
use "Group ID: %s"; update the two user constants
(_AM_SYSTEM_MODULES_ACCESS_USER_ADD and
_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR) to use "Group ID %s" (remove the
colon) so all four messages follow the same format.
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD', 'Added user access right for Group ID: %s'); | ||
| define('_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR', 'ERROR: Could not add user access right for Group ID: %s'); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for all references to the user-access constants
echo "=== References to new _AM_SYSTEM_MODULES_ACCESS_USER_ADD (success) ==="
rg -rn --type php '_AM_SYSTEM_MODULES_ACCESS_USER_ADD[^_]' || echo "No matches found"
echo ""
echo "=== References to _AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR (repurposed) ==="
rg -rn --type php '_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR' || echo "No matches found"
echo ""
echo "=== References to removed _AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR_ERROR ==="
rg -rn --type php '_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR_ERROR' || echo "No matches found"
echo ""
echo "=== Context: Definition file location ==="
cat -n htdocs/modules/system/language/english/admin/modulesadmin.php | sed -n '136,142p'Repository: XOOPS/XoopsCore25
Length of output: 1786
Format consistency: Use uniform punctuation for message placeholders.
The new constants at lines 138–139 have a colon after "Group ID" (Group ID: %s), but the admin equivalents at lines 136–137 omit it (Group ID %s). Choose one style and apply it consistently across both admin and user message sets.
Note: All call sites already correctly reference these constants with their intended semantic meaning (success vs. error), so the constant refactoring is coordinated.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@htdocs/modules/system/language/english/admin/modulesadmin.php` around lines
138 - 139, The two new language constants _AM_SYSTEM_MODULES_ACCESS_USER_ADD and
_AM_SYSTEM_MODULES_ACCESS_USER_ADD_ERROR use "Group ID: %s" with a colon while
the admin counterparts use "Group ID %s" without a colon; update these two
constants to remove the colon so they read "Group ID %s" to keep punctuation
consistent with the admin messages, and run a quick grep for
_AM_SYSTEM_MODULES_ACCESS_* to ensure all related message pairs use the same
placeholder format.
|
This has been already fixed, see: #1621 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1628 +/- ##
========================================
Coverage ? 0
========================================
Files ? 0
Lines ? 0
Branches ? 0
========================================
Hits ? 0
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



Summary by CodeRabbit