Skip to content

Commit

Permalink
Update smarty localize for Smarty3
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Oct 11, 2023
1 parent 9272ab1 commit 30dea4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CRM/Core/Smarty/plugins/block.localize.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@
* @return string
* multilingualized query
*/
function smarty_block_localize($params, $text, &$smarty, &$repeat) {
function smarty_block_localize($params, $text, $smarty, &$repeat) {
if ($repeat) {
// For opening tag text is always null
return '';
}

if (!array_key_exists('multilingual', $smarty->_tpl_vars) || !$smarty->_tpl_vars['multilingual']) {
if (!$smarty->getTemplateVars('multilingual')) {
return $text;
}

$lines = [];
foreach ($smarty->_tpl_vars['locales'] as $locale) {
foreach ($smarty->getTemplateVars('locales') as $locale) {
$line = $text;
if (isset($params['field'])) {
$fields = explode(',', $params['field']);
Expand Down

0 comments on commit 30dea4b

Please sign in to comment.