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

Render translated strings as HTML, not text (#1225)

- This corrects a bug that prevented apostrophes from working correctly as thousands separators.
parent c9612d95
No related merge requests found
...@@ -33,7 +33,7 @@ function buildFacetNodes(data, currentPath, allowExclude, excludeTitle, counts) ...@@ -33,7 +33,7 @@ function buildFacetNodes(data, currentPath, allowExclude, excludeTitle, counts)
if (!this.isApplied && counts) { if (!this.isApplied && counts) {
$('<span/>') $('<span/>')
.addClass('badge') .addClass('badge')
.text( .html(
this.count.toString().replace(/\B(?=(\d{3})+\b)/g, VuFind.translate('number_thousands_separator')) this.count.toString().replace(/\B(?=(\d{3})+\b)/g, VuFind.translate('number_thousands_separator'))
) )
.appendTo($html); .appendTo($html);
...@@ -155,11 +155,11 @@ VuFind.register('lightbox_facets', function LightboxFacets() { ...@@ -155,11 +155,11 @@ VuFind.register('lightbox_facets', function LightboxFacets() {
var sort = $(button).data('sort'); var sort = $(button).data('sort');
var list = $('#facet-list-' + sort); var list = $('#facet-list-' + sort);
if (list.find('.js-facet-item').length === 0) { if (list.find('.js-facet-item').length === 0) {
list.find('.js-facet-next-page').text(VuFind.translate('loading') + '...'); list.find('.js-facet-next-page').html(VuFind.translate('loading') + '...');
$.ajax(button.href + '&layout=lightbox') $.ajax(button.href + '&layout=lightbox')
.done(function facetSortTitleDone(data) { .done(function facetSortTitleDone(data) {
list.prepend($('<span>' + data + '</span>').find('.js-facet-item')); list.prepend($('<span>' + data + '</span>').find('.js-facet-item'));
list.find('.js-facet-next-page').text(VuFind.translate('more') + ' ...'); list.find('.js-facet-next-page').html(VuFind.translate('more') + ' ...');
}); });
} }
$('.full-facet-list').addClass('hidden'); $('.full-facet-list').addClass('hidden');
...@@ -182,7 +182,7 @@ VuFind.register('lightbox_facets', function LightboxFacets() { ...@@ -182,7 +182,7 @@ VuFind.register('lightbox_facets', function LightboxFacets() {
return false; return false;
} }
button.attr('disabled', 1); button.attr('disabled', 1);
button.text(VuFind.translate('loading') + '...'); button.html(VuFind.translate('loading') + '...');
$.ajax(this.href + '&layout=lightbox') $.ajax(this.href + '&layout=lightbox')
.done(function facetLightboxMoreDone(data) { .done(function facetLightboxMoreDone(data) {
var htmlDiv = $('<div>' + data + '</div>'); var htmlDiv = $('<div>' + data + '</div>');
...@@ -191,7 +191,7 @@ VuFind.register('lightbox_facets', function LightboxFacets() { ...@@ -191,7 +191,7 @@ VuFind.register('lightbox_facets', function LightboxFacets() {
if (list.length && htmlDiv.find('.js-facet-next-page').length) { if (list.length && htmlDiv.find('.js-facet-next-page').length) {
button.attr('data-page', page + 1); button.attr('data-page', page + 1);
button.attr('href', button.attr('href').replace(/facetpage=\d+/, 'facetpage=' + (page + 1))); button.attr('href', button.attr('href').replace(/facetpage=\d+/, 'facetpage=' + (page + 1)));
button.text(VuFind.translate('more') + ' ...'); button.html(VuFind.translate('more') + ' ...');
button.removeAttr('disabled'); button.removeAttr('disabled');
} else { } else {
button.remove(); button.remove();
......
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