]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6925 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 21 May 2024 06:57:26 +0000 (08:57 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 21 May 2024 06:57:26 +0000 (08:57 +0200)
app/Models/Base/ToolboxBaseTranslate.php
app/Models/FluidbookPublication.php

index 5aff0f1aa7ab847169f20ad98b25566e4fc2b8b5..0d2bfaf41ead45dde53b50618a47c87e20755bcb 100644 (file)
@@ -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] = [];
index 11a6a25a08c0a77b0ccc52346294ce827f9a1cf7..b053ecc6f43076356dd9e8cd5ae74d65b7f1e8bf 100644 (file)
@@ -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];