]> _ Git - cubist_cms-back.git/commitdiff
wip #6462
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 8 Nov 2023 15:57:24 +0000 (16:57 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 8 Nov 2023 15:57:24 +0000 (16:57 +0100)
src/app/Magic/Models/Translate.php

index a4bfd51d8c55f345b3011a6f893d2b30af9f34d3..bedff7ed20e6543a56b41eef4c8be1b873fb9846 100644 (file)
@@ -58,6 +58,7 @@ class Translate extends CubistMagicTranslatableModel
         $currentSection = '-';
         $sections = [$currentSection => []];
 
+        $locations = $translate->getStringToTranslateLocations();
 
         foreach ($translate->getStringToTranslate() as $sectionLabel => $strings) {
             $toTranslate = [];
@@ -97,12 +98,17 @@ class Translate extends CubistMagicTranslatableModel
                     $label = '??';
                 }
 
+                $loc = '';
+                if (isset($locations[$string])) {
+                    $loc = implode("\n", $locations[$string]);
+                }
                 $sections[$currentSection][] = ['name' => $key,
                     'label' => $label,
                     'type' => Textarea::class,
                     'rows' => 1,
                     'translatable' => true,
                     'store_in' => 'content',
+                    'hint' => $loc,
                     'fake' => true];
             }
         }