User tests: Successful: Unsuccessful:
Pull Request for Issue #24846 .
Load language on after initialise.
No constant value, the actionlog message is translated.
As expected result.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Language & Strings Front End Plugins |
Title |
|
Diff would be
diff --git a/plugins/system/actionlogs/actionlogs.php b/plugins/system/actionlogs/actionlogs.php
index 521b510..0d4f97d 100644
--- a/plugins/system/actionlogs/actionlogs.php
+++ b/plugins/system/actionlogs/actionlogs.php
@@ -64,4 +64,23 @@
/**
+ * Listener for the `onAfterInitialise` event
+ *
+ * @return void
+ *
+ * @since 4.0
+ */
+ public function onAfterInitialise()
+ {
+ if (!$this->app->isClient('administrator'))
+ {
+ return;
+ }
+
+ // Load plugin language files only when needed (ex: they are not needed in site client).
+ $this->loadLanguage();
+ }
+
+
+ /**
* Adds additional fields to the user editing form for logs e-mail notifications
*
@twister65
Please modify your PR with the code above.
Labels |
Added:
?
?
|
Category | Administration Language & Strings Front End Plugins | ⇒ | Front End Plugins |
Labels |
Removed:
?
|
I have tested this item
I have tested this item
protected $autoloadLanguage = true;
you need to remove this class property otherwise it will always be loaded in the constructor anyhow?
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-05-10 21:18:36 |
Closed_By | ⇒ | wilsonge |
Thanks!
This is not the right fix. The underlying issue has been discussed here #17444. Until it is fixed, plugin language files can be loaded manually with
$this->loadLanguage()
inonAfterInitialise()
.