From e43ef9d23af9de60f555dd4cd4efcced94e4f1ea Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 8 Nov 2023 17:19:38 +0100 Subject: [PATCH] wait #6462 @0.25 --- app/Fields/ElearningTranslatedString.php | 2 +- app/Models/Base/ToolboxContentTranslate.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Fields/ElearningTranslatedString.php b/app/Fields/ElearningTranslatedString.php index 7a1a1fd3f..c661aea4b 100644 --- a/app/Fields/ElearningTranslatedString.php +++ b/app/Fields/ElearningTranslatedString.php @@ -28,7 +28,7 @@ class ElearningTranslatedString extends SelectFromArray { $locale = 'en'; - $translations = ElearningTranslate::getLocaleTranslations($locale); + $translations = ElearningTranslate::getLocaleTranslations($locale, false); $res = []; foreach ($translations as $k => $translation) { if ($k === 'k' || $k === 'nsis') { diff --git a/app/Models/Base/ToolboxContentTranslate.php b/app/Models/Base/ToolboxContentTranslate.php index 1e041b2f5..061e86d45 100644 --- a/app/Models/Base/ToolboxContentTranslate.php +++ b/app/Models/Base/ToolboxContentTranslate.php @@ -6,6 +6,7 @@ use App\Http\Controllers\Admin\Operations\ContentTranslate\ExcelExportOperation; use App\Http\Controllers\Admin\Operations\ContentTranslate\ExcelImportOperation; use Cubist\Backpack\Facades\App; use Cubist\Backpack\Magic\Models\Translate; +use Cubist\Util\Files\Files; use Cubist\Util\PHP; use Illuminate\Support\Facades\Cache; @@ -55,7 +56,7 @@ class ToolboxContentTranslate extends Translate protected static function _getCacheKey() { - return 'all_' . static::$_name . '_translations'; + return 'all_' . Files::hashFileAttributes(__FILE__) . '_' . static::$_name . '_translations'; } public static function getAllTranslations($force = true) @@ -75,10 +76,10 @@ class ToolboxContentTranslate extends Translate } $res = []; - foreach ($json as $code => $tr) { $res[$code] = []; foreach ($tr as $k => $v) { + $res[$code][$k] = ['str' => static::keyToStr($k), 'translation' => $v]; } } -- 2.39.5