From: Vincent Vanwaelscappel Date: Tue, 21 May 2024 06:57:26 +0000 (+0200) Subject: wait #6925 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dce34385fa3ff5103b16f099c320202781831c7b;p=fluidbook-toolbox.git wait #6925 @0.5 --- diff --git a/app/Models/Base/ToolboxBaseTranslate.php b/app/Models/Base/ToolboxBaseTranslate.php index 5aff0f1aa..0d2bfaf41 100644 --- a/app/Models/Base/ToolboxBaseTranslate.php +++ b/app/Models/Base/ToolboxBaseTranslate.php @@ -110,9 +110,9 @@ class ToolboxBaseTranslate extends Translate return static::$_allTranslations; } - public static function getCompiledTranslations() + public static function getCompiledTranslations($force = false) { - $raw = static::getAllTranslations(); + $raw = static::getAllTranslations($force); $res = []; foreach ($raw as $code => $data) { $res[$code] = []; diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index 11a6a25a0..b053ecc6f 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -696,8 +696,8 @@ class FluidbookPublication extends ToolboxStatusModel public function getDefaultTranslations($l10n = null) { $defaultLocale = $this->locale; - if (null === $l10n) { - $l10n = FluidbookTranslate::getCompiledTranslations(); + if (null === $l10n || !isset($l10n[$defaultLocale])) { + $l10n = FluidbookTranslate::getCompiledTranslations(!isset($l10n[$defaultLocale])); } $res = $l10n[$defaultLocale];