Skip to content

Commit

Permalink
Display to the user the active theme when scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
octoberapp committed Jul 27, 2023
1 parent c1b2a5e commit 168e4fb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions controllers/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Flash;
use BackendMenu;
use Cms\Classes\Theme;
use Backend\Classes\Controller;
use RainLab\Translate\Models\Message;
use RainLab\Translate\Classes\Locale;
Expand Down Expand Up @@ -97,6 +98,8 @@ public function onClearCache()
*/
public function onLoadScanMessagesForm()
{
$this->vars['activeTheme'] = Theme::getActiveTheme();

return $this->makePartial('scan_messages_form');
}

Expand Down
14 changes: 13 additions & 1 deletion controllers/messages/_scan_messages_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
<?= __("This process will attempt to scan the active theme for messages that can be translated.") ?>
<?= __("Some messages may not be captured and will only appear after the first time they are used.") ?>
</p>
<?php if ($activeTheme): ?>
<div class="callout callout-info no-icon no-subheader no-title is-flush">
<div class="content">
<p>
<?= __("Active Theme") ?>:
<strong>
<?= e($activeTheme->getConfigValue('name')) ?>
(<?= e($activeTheme->getDirName()) ?>)
</strong>
</p>
</div>
</div>
<?php endif ?>
<div class="form-preview">
<div class="form-group">
<!-- Checkbox -->
Expand Down Expand Up @@ -46,7 +59,6 @@ class="form-check-input"
</div>
</div>
</div>

</div>
<div class="modal-footer">
<div class="loading-indicator-container">
Expand Down
3 changes: 2 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
"Last Seen": "Last Seen",
"Never": "Never",
"Purge missing messages afterwards": "Purge missing messages afterwards",
"If checked, after the scan, delete any messages that the scanner did not find.": "If checked, after the scan, delete any messages that the scanner did not find."
"If checked, after the scan, delete any messages that the scanner did not find.": "If checked, after the scan, delete any messages that the scanner did not find.",
"Active Theme": "Active Theme"
}

0 comments on commit 168e4fb

Please sign in to comment.