diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index 6d986aa0..fc66323e 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -98,6 +98,8 @@ function openDialog(element, on_success) {
}
function on_form_loaded() {
+ // Should be defined (and localized) in the theme
+ MSG_CANCEL = MSG_CANCEL || 'Cancel';
var eCancel = '' + MSG_CANCEL + '';
if ($("#gDialog .submit").length) {
$("#gDialog .submit").addClass("ui-state-default ui-corner-all");
diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php
index fed1afe6..36deea9e 100644
--- a/themes/admin_default/views/admin.html.php
+++ b/themes/admin_default/views/admin.html.php
@@ -21,6 +21,10 @@
= $theme->script("lib/jquery.form.js") ?>
= $theme->script("lib/jquery-ui.js") ?>
= $theme->script("lib/gallery.common.js") ?>
+ /* MSG_CANCEL is required by gallery.dialog.js */ ?>
+
= $theme->script("lib/gallery.dialog.js") ?>
= $theme->script("lib/superfish/js/superfish.js") ?>
= $theme->theme_script("js/jquery.dropshadow.js") ?>