Skip to content
Snippets Groups Projects
Commit d38204a3 authored by Demian Katz's avatar Demian Katz
Browse files

Merge pull request #326 from EreMaijala/hierarchical-facet-localization

Show localized numbers in hierarchical facets.
parents 176fcbd8 d8cd0994
No related merge requests found
...@@ -95,7 +95,10 @@ class JsTranslations extends AbstractHelper ...@@ -95,7 +95,10 @@ class JsTranslations extends AbstractHelper
{ {
$parts = []; $parts = [];
foreach ($this->strings as $k => $v) { foreach ($this->strings as $k => $v) {
$parts[] = $k . ': "' . addslashes($this->transEsc->__invoke($v)) . '"'; $translation = is_array($v)
? call_user_func_array(array($this->transEsc, '__invoke'), $v)
: $this->transEsc->__invoke($v);
$parts[] = $k . ': "' . addslashes($translation) . '"';
} }
return $this->varName . ' = {' . implode(',', $parts) . '};'; return $this->varName . ' = {' . implode(',', $parts) . '};';
} }
......
...@@ -6,7 +6,7 @@ function buildFacetNodes(data, currentPath, allowExclude, excludeTitle, counts) ...@@ -6,7 +6,7 @@ function buildFacetNodes(data, currentPath, allowExclude, excludeTitle, counts)
$(data).each(function() { $(data).each(function() {
var html = ''; var html = '';
if (!this.isApplied && counts) { if (!this.isApplied && counts) {
html = '<span class="badge" style="float: right">' + this.count; html = '<span class="badge" style="float: right">' + this.count.toString().replace(/\B(?=(\d{3})+\b)/g, vufindString.number_thousands_separator);
if (allowExclude) { if (allowExclude) {
var excludeURL = currentPath + this.exclude; var excludeURL = currentPath + this.exclude;
excludeURL.replace("'", "\\'"); excludeURL.replace("'", "\\'");
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
'bulk_save_success' => 'bulk_save_success', 'bulk_save_success' => 'bulk_save_success',
'close' => 'close', 'close' => 'close',
'loading' => 'Loading', 'loading' => 'Loading',
'sms_success' => 'sms_success' 'sms_success' => 'sms_success',
'number_thousands_separator' => ['number_thousands_separator', null, ',']
) )
); );
if ($cart->isActive()) { if ($cart->isActive()) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment