enabled "press x to close" string for lightbox2 lite to be translated if
authorStella Power
Wed, 3 Oct 2007 13:02:51 +0000 (13:02 +0000)
committerStella Power
Wed, 3 Oct 2007 13:02:51 +0000 (13:02 +0000)
necessary.

js/lightbox_lite.js
lightbox2.module

index 546de77..677c99a 100644 (file)
@@ -405,9 +405,10 @@ function initLightbox() {
   objLightboxDetails.appendChild(objCaption);
 
   // create keyboard message
+  var settings = Drupal.settings.lightbox2;
   var objKeyboardMsg = document.createElement("div");
   objKeyboardMsg.setAttribute('id', 'keyboardMsg');
-  objKeyboardMsg.innerHTML = 'press <a href="#" onclick="hideLightbox(); return false;"><kbd>x</kbd></a> to close';
+  objKeyboardMsg.innerHTML = settings.lite_press_x_close;
   objLightboxDetails.appendChild(objKeyboardMsg);
 
 
index a96e4fc..564515a 100644 (file)
@@ -248,7 +248,7 @@ function lightbox2_add_files() {
     'disable_for_gallery_lists' => variable_get('lightbox2_disable_nested_galleries', true),
     'node_link_text' => t(variable_get('lightbox2_node_link_text', 'View Image Details')),
     'image_count' => t(variable_get('lightbox2_image_count_str', 'Image !current of !total')),
-    'lite_press_x_close' => t(variable_get('lightbox2_lite_press_x_close', 'press <em>x</em> to close')),
+    'lite_press_x_close' => t('press !x to close', array('!x' => '<a href="#" onclick="hideLightbox(); return false;"><kbd>x</kbd></a>'),
   );
   drupal_add_js(array('lightbox2' => $js_settings), 'setting');