From 5c73ffe7d9e474066ba5a1296ab12fa85a8ce721 Mon Sep 17 00:00:00 2001 From: Harald Leithner Date: Sun, 27 Jun 2021 13:20:13 +0200 Subject: [PATCH] Allow new language files without language tag (#46) * Allow new language files without language tag * Allow new language files without language tag also for packages --- src/Tasks/Build/Language.php | 6 +++--- src/Tasks/Deploy/Package.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Tasks/Build/Language.php b/src/Tasks/Build/Language.php index c46b12c..50f63fe 100644 --- a/src/Tasks/Build/Language.php +++ b/src/Tasks/Build/Language.php @@ -146,12 +146,12 @@ public function run() private function analyze() { // Check for all languages here - if (empty(glob($this->adminLangPath . "/*/*." . $this->ext . "*.ini"))) + if (empty(glob($this->adminLangPath . "/*/*" . $this->ext . "*.ini"))) { $this->hasAdminLang = false; } - if (empty(glob($this->frontLangPath . "/*/*." . $this->ext . "*.ini"))) + if (empty(glob($this->frontLangPath . "/*/*" . $this->ext . "*.ini"))) { $this->hasFrontLang = false; } @@ -238,7 +238,7 @@ public function copyLanguage($dir, $target) while ($file = readdir($fileHdl)) { // Only copy language files for this extension (and sys files..) - if (substr($file, 0, 1) != '.' && strpos($file, $this->ext . ".")) + if (substr($file, 0, 1) !== '.' && strpos($file, $this->ext . ".") !== false) { $files[] = array($entry => $file); diff --git a/src/Tasks/Deploy/Package.php b/src/Tasks/Deploy/Package.php index 124b84e..2198ec6 100644 --- a/src/Tasks/Deploy/Package.php +++ b/src/Tasks/Deploy/Package.php @@ -536,7 +536,7 @@ public function createPackageZip() // If the package has language files, add those $pkg_languages_path = $pkg_path . "/language"; - $languages = glob($pkg_languages_path . "/*/*.pkg_" . $this->getExtensionName() . "*.ini"); + $languages = glob($pkg_languages_path . "/*/*pkg_" . $this->getExtensionName() . "*.ini"); // Add all package language files foreach ($languages as $lang_path)