Browse Source

translation 没内容再 用原文数据

visuddhinanda 2 years ago
parent
commit
235469b563
1 changed files with 11 additions and 7 deletions
  1. 11 7
      app/Http/Api/TemplateRender.php

+ 11 - 7
app/Http/Api/TemplateRender.php

@@ -590,17 +590,21 @@ class TemplateRender{
                    count($props['translation']) > 0
                    ){
                     $sentences = $props['translation'];
-                }else if(isset($props['origin']) &&
-                         is_array($props['origin']) &&
-                         count($props['origin']) > 0
-                         ){
-                    $sentences = $props['origin'];
-                }
-                if(isset($sentences)){
                     foreach ($sentences as $key => $value) {
                         $output .= $value['html'];
                     }
                 }
+                if(empty($output)){
+                    if(isset($props['origin']) &&
+                            is_array($props['origin']) &&
+                            count($props['origin']) > 0
+                            ){
+                        $sentences = $props['origin'];
+                        foreach ($sentences as $key => $value) {
+                            $output .= $value['html'];
+                        }
+                    }
+                }
                 break;
             default:
                 $output = '';