From 7ac97c60a07b1fc746c6cea055ea199f5adce02e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20de=20la=20Pen=CC=83a?=
Date: Fri, 4 Sep 2026 09:18:44 +0100
Subject: [PATCH] refactor: Load language lines via the Translation service
Replaces `get_instance()->lang->load('admin/admin_generic')` with `Factory::service('Translation')->load('admin_generic')`, which works outside a CodeIgniter request.
Co-Authored-By: Claude Fable 5.1
(cherry picked from commit c96be4e86d9a804569467522871e18ec9d15a1be)
---
src/Controller/Base.php | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/Controller/Base.php b/src/Controller/Base.php
index 4fb9052f..f54ef697 100644
--- a/src/Controller/Base.php
+++ b/src/Controller/Base.php
@@ -85,7 +85,8 @@ public function __construct()
$this
->loadConfigs()
- ->loadHelpers();
+ ->loadHelpers()
+ ->loadLanguages();
// --------------------------------------------------------------------------
@@ -188,6 +189,16 @@ protected function loadHelpers(): self
* @throws \Nails\Common\Exception\AssetException
* @throws FactoryException
*/
+ protected function loadLanguages(): self
+ {
+ // @todo (Pablo - 2018-09-24) - Remove this
+ Factory::service('Translation')->load('admin_generic');
+
+ return $this;
+ }
+
+ // --------------------------------------------------------------------------
+
protected function loadCss(): self
{
/** @var Asset $oAsset */