From f52743602fb44734bfffbc11340fb411e0b482c4 Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 12 Jul 2023 15:52:52 +0800 Subject: [PATCH] Fix #7732 - add strings_map to translated JS strings --- OutputTranslations.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OutputTranslations.php b/OutputTranslations.php index 25e0f2af..59c10b4c 100644 --- a/OutputTranslations.php +++ b/OutputTranslations.php @@ -60,9 +60,10 @@ class Pman_Cms_OutputTranslations extends Pman $ret[$t->template_id_template] = array(); } - $ret[$t->template_id_template][$t->src_id_mdsum] = (empty($t->txt)) ? $t->src_id_txt : $t->txt; + $ret[$t->template_id_template]['_strings'][$t->src_id_mdsum] = (empty($t->txt)) ? $t->src_id_txt : $t->txt; + $ret[$t->template_id_template]['_strings_map'][$t->src_id_txt] = $t->src_id_mdsum; } - + return $ret; } @@ -91,11 +92,13 @@ class Pman_Cms_OutputTranslations extends Pman $output = ""; foreach ($translations as $file => $trans){ - $t = json_encode($trans); + $t = json_encode($trans['_strings']); + $tmap = json_encode($trans['_strings_map']); $cls = str_replace('.bjs', '', $file); $output .= "try { "; $output .= "Roo.apply({$cls}._strings, {$t});"; + $output .= "Roo.apply({$cls}._strings_map, {$tmap});"; $output .= " } "; $output .= "catch(e){}; "; } -- 2.39.2