Smarty {ts} -- For extensions, use fallback similar to E::ts() and JS ts()
authorTim Otten <totten@civicrm.org>
Thu, 19 Jan 2023 04:42:36 +0000 (20:42 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 19 Jan 2023 04:42:36 +0000 (20:42 -0800)
CRM/Core/Smarty/plugins/block.ts.php

index f3cbd36fe95276980d7d399a15152d825f897d5f..6c1faeffd010c62eb04c91554d40b4e1e2261cfa 100644 (file)
@@ -34,8 +34,8 @@
  *   the string, translated by gettext
  */
 function smarty_block_ts($params, $text, &$smarty) {
-  if (!isset($params['domain'])) {
-    $params['domain'] = $smarty->get_template_vars('extensionKey');
+  if (!isset($params['domain']) && $extensionKey = $smarty->get_template_vars('extensionKey')) {
+    $params['domain'] = is_array($extensionKey) ? $extensionKey : [$extensionKey, NULL];
   }
   return ts($text, $params);
 }