summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-06-29 20:55:23 -0700
committerAndy Staudacher <andy.st@gmail.com>2009-06-29 20:55:23 -0700
commit0eb9a2aacd33d9d98726d08f828f10df4e462e9e (patch)
treee4ff38bf4e40b58c88bb7a6c72965d8626b2d86d
parent77a78b49909f9d2ca598871f0588497837cb9f6a (diff)
Fix for ticket 86 - Make Cancel button in doalogs localizable.
-rw-r--r--lib/gallery.dialog.js3
-rw-r--r--themes/default/views/page.html.php4
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index 72c7cdf8..6d986aa0 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -50,7 +50,6 @@ function openDialog(element, on_success) {
var sHref = $(element).attr("href");
var sTitle = $(element).attr("title");
var eDialog = '<div id="gDialog"></div>';
- // @todo Fix i18n for Cancel link
var dialogWidth;
$("body").append(eDialog);
@@ -99,7 +98,7 @@ function openDialog(element, on_success) {
}
function on_form_loaded() {
- var eCancel = '<a href="javascript: closeDialog()" class="gCancel">Cancel</a>';
+ var eCancel = '<a href="javascript: closeDialog()" class="gCancel">' + MSG_CANCEL + '</a>';
if ($("#gDialog .submit").length) {
$("#gDialog .submit").addClass("ui-state-default ui-corner-all");
$("#gDialog .submit").parent().append(eCancel);
diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php
index 519a0c39..a21e9eff 100644
--- a/themes/default/views/page.html.php
+++ b/themes/default/views/page.html.php
@@ -49,6 +49,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 */ ?>
+ <script type="text/javascript">
+ var MSG_CANCEL = "<?= t('Cancel') ?>";
+ </script>
<?= $theme->script("lib/gallery.dialog.js") ?>
<?= $theme->script("lib/gallery.form.js") ?>
<?= $theme->script("lib/superfish/js/superfish.js") ?>