Fixed IE bug, you must use html:msg for the msg elements that jquery.localize uses...
authorTrevor Parscal <tparscal@users.mediawiki.org>
Wed, 12 Jan 2011 20:43:23 +0000 (20:43 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Wed, 12 Jan 2011 20:43:23 +0000 (20:43 +0000)
resources/jquery/jquery.localize.js

index 29f606f..a94dfe8 100644 (file)
@@ -6,9 +6,12 @@
  * with localized text, elements with title-msg and alt-msg attributes will receive localized title
  * and alt attributes.
  *
+ * Note that "msg" elements must have html namespacing such as "<html:msg />" to be compatible with
+ * Internet Explorer.
+ *
  * Example:
  *             <p class="somethingCool">
- *                     <msg key="my-message" />
+ *                     <html:msg key="my-message" />
  *                     <img src="something.jpg" title-msg="my-title-message" alt-msg="my-alt-message" />
  *             </p>
  *
  * @param Object: options Map of options
  *  * prefix: Message prefix to use when localizing elements and attributes
  */
+
 $.fn.localize = function( options ) {
        options = $.extend( { 'prefix': '' }, options );
        return $(this)
-               .find( 'msg' )
+               .find( 'msg,html\\:msg' )
                        .each( function() {
                                $(this)
                                        .text( mediaWiki.msg( options.prefix + $(this).attr( 'key' ) ) )
@@ -50,4 +54,7 @@ $.fn.localize = function( options ) {
                                        .removeAttr( 'alt-msg' );
                        } )
                        .end();
-};
\ No newline at end of file
+};
+
+// Let IE know about the msg tag before it's used...
+document.createElement( 'msg' );