From 62e2562cef0db7cff0d8ab442168f93b106dd917 Mon Sep 17 00:00:00 2001 From: abarrau Date: Sun, 11 Apr 2021 08:34:55 +0200 Subject: [PATCH] add to use english language if ask not found add to use the english language file, if the ask language not found --- system/core/Lang.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/system/core/Lang.php b/system/core/Lang.php index 569b0236..cc371cd4 100644 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -146,8 +146,22 @@ 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);