From efa319ecb8dabc22af2550729ad399afac03af40 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Fri, 14 Jan 2022 09:53:53 +0100 Subject: [PATCH] [Language] If core language files not found, use English. Fix by @abarrau --- system/core/Lang.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/system/core/Lang.php b/system/core/Lang.php index 569b0236..01baaab9 100644 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -146,8 +146,23 @@ class CI_Lang { break; } } - } + // try to load in default language (english) // + if (($found !== TRUE)&&($idiom != 'english')) { + $idiom = 'english'; + foreach (get_instance()->load->get_package_paths(TRUE) as $package_path) + { + $package_path .= 'language/'.$idiom.'/'.$langfile; + if ($basepath !== $package_path && file_exists($package_path)) + { + include($package_path); + $found = TRUE; + break; + } + } + } + } + if ($found !== TRUE) { show_error('Unable to load the requested language file: language/'.$idiom.'/'.$langfile);