]> _ Git - fluidbook-toolbox.git/commitdiff
wait #4627 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 29 Oct 2021 13:16:07 +0000 (15:16 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 29 Oct 2021 13:16:07 +0000 (15:16 +0200)
app/Http/Controllers/Admin/Operations/FluidbookTranslate/ExcelExportOperation.php

index f865e988a9fa87763e73a283fff328373d6c1855..06756c6f750ebfaf8545ff2b63faa6e5f017198e 100644 (file)
@@ -84,7 +84,16 @@ trait ExcelExportOperation
 
     protected function _getTranslations($alldata, $locale)
     {
-        $data = $alldata[$locale];
+        if (isset($alldata[$locale])) {
+            $data = $alldata[$locale];
+        } else {
+            $e = explode('_', $locale);
+            if (isset($alldata[$e[0]])) {
+                $data = $alldata[$e[0]];
+            } else {
+                $data = $alldata['en'];
+            }
+        }
         $res = [];
         foreach ($data as $k => $v) {
             if ($k === 'k') {