Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 5 | | | |
bc77d7c0 TO |
6 | | This work is published under the GNU AGPLv3 license with some | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
6a488035 TO |
11 | |
12 | /** | |
13 | * CiviCRM's Smarty gettext plugin | |
14 | * | |
15 | * @package CRM | |
16 | * @author Piotr Szotkowski <shot@caltha.pl> | |
17 | * @author Michal Mach <mover@artnet.org> | |
ca5cec67 | 18 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
6a488035 TO |
19 | */ |
20 | ||
21 | /** | |
22 | * Smarty block function providing gettext support | |
23 | * | |
24 | * See CRM_Core_I18n class documentation for details. | |
25 | * | |
6a0b768e TO |
26 | * @param array $params |
27 | * Template call's parameters. | |
28 | * @param string $text | |
29 | * {ts} block contents from the template. | |
16b10e64 | 30 | * @param CRM_Core_Smarty $smarty |
6a0b768e | 31 | * The Smarty object. |
6a488035 | 32 | * |
a6c01b45 | 33 | * @return string |
353ffa53 | 34 | * the string, translated by gettext |
6a488035 TO |
35 | */ |
36 | function smarty_block_ts($params, $text, &$smarty) { | |
d9aa1c6b TO |
37 | if (!isset($params['domain'])) { |
38 | $params['domain'] = $smarty->get_template_vars('extensionKey'); | |
39 | } | |
6a488035 TO |
40 | return ts($text, $params); |
41 | } |