Skip to content

Commit

Permalink
Ensures new language files take precedence over old ones
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <[email protected]>
  • Loading branch information
Sesquipedalian committed Jan 29, 2024
1 parent 0addb30 commit 04612aa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Sources/Lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ public static function load(string $template_name, string $lang = '', bool $fata
}

// Legacy language calls.
if (Config::$backward_compatibility) {
$found = self::loadOld($attempts) || $found;
if (!$found && Config::$backward_compatibility) {
$found = self::loadOld($attempts);
}

// That couldn't be found! Log the error, but *try* to continue normally.
Expand Down Expand Up @@ -734,10 +734,11 @@ public static function loadOld(array $attempts): bool
$found = false;

/**
* $file[] =
* 0 => Directory
* 1 => File
* 2= Locale.
* $file = [
* 0 => Directory
* 1 => File
* 2 => Locale
* ]
*/
foreach ($attempts as $k => $file) {
$oldLanguage = $locale_to_lang[$file[2]] ?? false;
Expand Down

0 comments on commit 04612aa

Please sign in to comment.