Skip to content
Browse files

Translate dataset_view inline strings.

  • Loading branch information...
1 parent cd33eaa commit 9677a8685c230fe262ecf798d95207250eb10947 @onyxfish onyxfish committed Aug 31, 2012
Showing with 13 additions and 17 deletions.
  1. +13 −17 client/static/js/views/dataset_view.js
View
30 client/static/js/views/dataset_view.js
@@ -85,9 +85,9 @@ PANDA.views.DatasetView = Backbone.View.extend({
showMessage: this.on_related_upload_message,
sizeLimit: PANDA.settings.MAX_UPLOAD_SIZE,
messages: {
- sizeError: "{file} is too large, the maximum file size is " + PANDA.settings.MAX_UPLOAD_SIZE + " bytes.",
- emptyError: "{file} is empty.",
- onLeave: "Your file is being uploaded, if you leave now the upload will be cancelled."
+ sizeError: interpolate(gettext("{file} is too large, the maximum file size is %(size)s bytes.", { size: PANDA.settings.MAX_UPLOAD_SIZE }, true)),
+ emptyError: gettext("{file} is empty."),
+ onLeave: gettext("Your file is being uploaded, if you leave now the upload will be cancelled.")
}
});
@@ -166,14 +166,14 @@ PANDA.views.DatasetView = Backbone.View.extend({
var upload = uploads.get(uri);
if (upload_type == "data" && upload.get("deletable") == false) {
- bootbox.alert("This data upload was created before deleting individual data uploads was supported. In order to delete it you must delete the entire dataset.");
+ bootbox.alert(gettext("This data upload was created before deleting individual data uploads was supported. In order to delete it you must delete the entire dataset."));
return false;
}
- var message = "<p>This will irreversibly destroy <strong>" + upload.get("title") + "</strong>. It will not be possible to recover this file.</p>";
-
if (upload_type == "data") {
- message += "<p><strong>All data imported from this file will also be deleted.</strong></p>";
+ var message = interpolate(gettext("<p>This will irreversibly destroy <strong>%(title)s</strong>. It will not be possible to recover this file.</p><p><strong>All data imported from this file will also be deleted.</strong></p>"), { title: upload.get("title") }, true);
+ } else {
+ var message = interpolate(gettext("<p>This will irreversibly destroy <strong>%(title)s</strong>. It will not be possible to recover this file.</p>"), { title: upload.get("title") }, true);
}
var deleter = function(result) {
@@ -304,12 +304,10 @@ PANDA.views.DatasetView = Backbone.View.extend({
typed_columns,
column_types,
function(dataset) {
- var note = "Your data indexing task has been successfully queued.";
-
if (PANDA.settings.EMAIL_ENABLED) {
- note += " You will receive an email when it is complete."
+ var note = gettext("Your data indexing task has been successfully queued. You will receive an email when it is complete.");
} else {
- note += " Your PANDA does not have email configured, so you will need to check your Notifications list to see when the task is complete."
+ var note = gettext("Your data indexing task has been successfully queued. Your PANDA does not have email configured, so you will need to check your Notifications list to see when the task is complete.");
}
bootbox.alert(
@@ -320,7 +318,7 @@ PANDA.views.DatasetView = Backbone.View.extend({
);
},
function(dataset, error) {
- bootbox.alert("<p>Your data indexing task failed to start!</p><p>Error:</p><code>" + error.traceback + "</code>");
+ bootbox.alert(interpolate(gettext("<p>Your data indexing task failed to start!</p><p>Error:</p><code>%(traceback)s</code>", { traceback:error.traceback }, true)));
});
},
@@ -332,18 +330,16 @@ PANDA.views.DatasetView = Backbone.View.extend({
null,
"all",
function(dataset) {
- var note = "Your export has been successfully queued.";
-
if (PANDA.settings.EMAIL_ENABLED) {
- note += " When it is complete you will be emailed a link to download the file."
+ var note = gettext("Your export has been successfully queued. When it is complete you will be emailed a link to download the file.");
} else {
- note += " Your PANDA does not have email configured, so you will need to check your Notifications list to see when it is ready to be downloaded."
+ var note = gettext("Your export has been successfully queued. Your PANDA does not have email configured, so you will need to check your Notifications list to see when it is ready to be downloaded.");
}
bootbox.alert(note);
},
function(dataset, error) {
- bootbox.alert("<p>Your export failed to start!</p><p>Error:</p><code>" + error.traceback + "</code>");
+ bootbox.alert(interpolate(gettext("<p>Your export failed to start!</p><p>Error:</p><code>%(traceback)s</code>", { traceback:error.traceback }, true)));
}
);
},

0 comments on commit 9677a86

Please sign in to comment.
Something went wrong with that request. Please try again.