Skip to content

Commit

Permalink
[#2710] Move api strings to the i18n object
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed Jul 25, 2012
1 parent c7a2bcb commit a8cebfd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ckan/public/base/javascript/modules/api-info.js
Expand Up @@ -11,7 +11,11 @@
this.ckan.module('api-info', function (jQuery, _) {
return {
options: {
template: null
template: null,
i18n: {
noTemplate: _('There is no API data to load for this resource').fetch(),
loadError: _('Failed to load data API information').fetch()
}
},
initialize: function () {
jQuery.proxyAll(this, /_on/);
Expand Down Expand Up @@ -43,7 +47,7 @@ this.ckan.module('api-info', function (jQuery, _) {
},
loadTemplate: function () {
if (!this.options.template) {
this.sandbox.notify(_('There is no API data to load for this resource').fetch());
this.sandbox.notify(this.options.i18n.noTemplate);
return jQuery.Deferred().reject().promise();
}

Expand All @@ -65,7 +69,7 @@ this.ckan.module('api-info', function (jQuery, _) {
},
_onTemplateError: function () {
this.loading(false);
this.sandbox.notify(_('Failed to load data API information').fetch());
this.sandbox.notify(this.options.i18n.loadError);
}
};
});

0 comments on commit a8cebfd

Please sign in to comment.