Skip to content

Commit f26733d

Browse files
committed
#16 - Fix syntax
1 parent aa0be35 commit f26733d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/TgUtils/Templating/CurrencyFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function __construct() {
1212

1313
public function format($value, $params, Processor $processor) {
1414
if ($value == NULL) return '';
15-
$currency = count($params) > 0 ? $params[0] : ''
15+
$currency = count($params) > 0 ? $params[0] : '';
1616
return trim(\TgUtils\FormatUtils::formatPrice($value, $currency, $processor->language, ' '));
1717
}
1818
}

src/TgUtils/Templating/Processor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function setLanguage($language) {
3535
* if attribute is missing, a snippet with this name will be searched
3636
* @param string $s - the content to be processed
3737
*/
38-
protected function process($s) {
38+
public function process($s) {
3939
$rc = '';
4040
$matches = array();
4141
preg_match_all('/{{(.*?)}}/', $s, $matches, PREG_OFFSET_CAPTURE);
@@ -70,6 +70,8 @@ protected function getVar($s) {
7070
else {
7171
$snippet = $this->getSnippet($object);
7272
if ($snippet != NULL) {
73+
if (is_string($snippet)) return $snippet;
74+
if (is_array($snippet)) return I18N::_($snippet, $this->language);
7375
return $snippet->getOutput($this);
7476
}
7577
}

0 commit comments

Comments
 (0)