Skip to content

Commit

Permalink
[ckan#3315] Mark remaining strings in JS modules as translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
torfsen committed Jan 31, 2017
1 parent c871c71 commit 9533d7a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
10 changes: 4 additions & 6 deletions ckan/public/base/javascript/modules/resource-view-filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ this.ckan.module('resource-view-filters', function (jQuery) {
resourceId = self.options.resourceId,
fields = self.options.fields,
dropdownTemplate = self.options.dropdownTemplate,
addFilterTemplate = self.options.addFilterTemplate,
addFilterTemplate = '<a href="#">' + self._('Add Filter') + '</a>';
filtersDiv = $('<div></div>');

var filters = ckan.views.filters.get();
Expand All @@ -26,7 +26,8 @@ this.ckan.module('resource-view-filters', function (jQuery) {
}

function _buildAddFilterButton(el, template, fields, filters, onChangeCallback) {
var addFilterButton = $(template),
var self = this,
addFilterButton = $(template),
currentFilters = Object.keys(filters),
fieldsNotFiltered = $.grep(fields, function (field) {
return !filters.hasOwnProperty(field);
Expand All @@ -48,7 +49,7 @@ this.ckan.module('resource-view-filters', function (jQuery) {
// TODO: Remove element from "data" when some select selects it.
addFilterInput.select2({
data: data,
placeholder: 'Select a field',
placeholder: self._('Select a field'),
width: 'resolve',
}).on('change', onChangeCallback);

Expand Down Expand Up @@ -175,9 +176,6 @@ this.ckan.module('resource-view-filters', function (jQuery) {
' {filter}:',
' <div class="resource-view-filter-values"></div>',
'</div>',
].join('\n'),
addFilterTemplate: [
'<a href="#">Add Filter</a>',
].join('\n')
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ckan.module('example_theme_popover', function ($) {
// Add a Bootstrap popover to the button. Since we don't have the HTML
// from the snippet yet, we just set the content to "Loading..."
this.el.popover({title: this.options.title, html: true,
content: 'Loading...', placement: 'left'});
content: this._('Loading...'), placement: 'left'});

// Add an event handler to the button, when the user clicks the button
// our _onClick() function will be called.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ckan.module('example_theme_popover', function ($) {
// Add a Bootstrap popover to the button. Since we don't have the HTML
// from the snippet yet, we just set the content to "Loading..."
this.el.popover({title: this.options.title, html: true,
content: 'Loading...', placement: 'left'});
content: this._('Loading...'), placement: 'left'});

// Add an event handler to the button, when the user clicks the button
// our _onClick() function will be called.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ckan.module('example_theme_popover', function ($) {
initialize: function () {
$.proxyAll(this, /_on/);
this.el.popover({title: this.options.title, html: true,
content: 'Loading...', placement: 'left'});
content: this._('Loading...'), placement: 'left'});
this.el.on('click', this._onClick);
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ckan.module('example_theme_popover', function ($) {
initialize: function () {
$.proxyAll(this, /_on/);
this.el.popover({title: this.options.title, html: true,
content: 'Loading...', placement: 'left'});
content: this._('Loading...'), placement: 'left'});
this.el.on('click', this._onClick);

// Subscribe to 'dataset_popover_clicked' events.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ckan.module('example_theme_popover', function ($) {
initialize: function () {
$.proxyAll(this, /_on/);
this.el.popover({title: this.options.title, html: true,
content: 'Loading...', placement: 'left'});
content: this._('Loading...'), placement: 'left'});
this.el.on('click', this._onClick);
this.sandbox.subscribe('dataset_popover_clicked',
this._onPopoverClicked);
Expand Down

0 comments on commit 9533d7a

Please sign in to comment.