Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions modules/system/controllers/eventlogs/_field_details.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php
if (!isset($value['logVersion']) || $value['logVersion'] !== 2) {
if ($value ?? false) {
printf(
'<h4>DETAILS</h4><pre style="background: #fff; padding: 10px; border: 1px solid #ddd;">%s</pre>',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Hardcoded DETAILS label bypasses i18n.

Every other user-visible string in this template goes through trans()/e(trans(...)). The new <h4>DETAILS</h4> heading is the only hardcoded English label, which will break non-English backends.

🌐 Proposed fix
-            '<h4>DETAILS</h4><pre style="background: `#fff`; padding: 10px; border: 1px solid `#ddd`;">%s</pre>',
+            '<h4>%s</h4><pre style="background: `#fff`; padding: 10px; border: 1px solid `#ddd`;">%s</pre>',
+            e(trans('system::lang.event_log.details.details')),
             e(print_r($value, true))

Add the corresponding translation key to the language files, e.g.:

// modules/system/lang/en/lang.php  (under event_log.details)
'details' => 'Details',
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modules/system/controllers/eventlogs/_field_details.php` at line 5, The
template contains a hardcoded heading string '<h4>DETAILS</h4><pre
style="background: `#fff`; padding: 10px; border: 1px solid `#ddd`;">%s</pre>' which
bypasses i18n; replace the '<h4>DETAILS</h4>' fragment with a translated call
(use e(trans(...)) consistent with the rest of the file) referencing a new
language key such as 'event_log.details' and add the corresponding 'details' =>
'Details' entry under the event_log (or module-specific) array in the language
files so non-English backends receive the translated heading.

e(print_r($value, true))
);
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
return;
}

Expand Down
Loading