Skip to content

Commit

Permalink
Json preview error is translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Nov 25, 2012
1 parent 3b1e670 commit 4a59efd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ckanext/jsonpreview/theme/public/preview_json.js
@@ -1,6 +1,11 @@
// json preview module
ckan.module('jsonpreview', function (jQuery, _) {
return {
options: {
i18n: {
error: _('An error occured: %(text)s %(error)s')
}
},
initialize: function () {
var self = this;
jQuery.ajax(preload_resource['url'], {
Expand All @@ -14,7 +19,7 @@ ckan.module('jsonpreview', function (jQuery, _) {
self.el.html(pretty);
},
error: function(jqXHR, textStatus, errorThrown) {
self.el.html('An error occured: ' + textStatus + ', ' + errorThrown);
self.el.html(self.i18n('error', {text: textStatus, error: errorThrown}));
}
});
},
Expand Down

0 comments on commit 4a59efd

Please sign in to comment.