From 85a453204ce78018fe266dee762ac0b19a89ce27 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Wed, 12 Jan 2011 20:43:23 +0000 Subject: [PATCH] Fixed IE bug, you must use html:msg for the msg elements that jquery.localize uses to translate things otherwise IE chokes when you insert them cause it doesn't know about the msg element. --- resources/jquery/jquery.localize.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/resources/jquery/jquery.localize.js b/resources/jquery/jquery.localize.js index 29f606f049..a94dfe881a 100644 --- a/resources/jquery/jquery.localize.js +++ b/resources/jquery/jquery.localize.js @@ -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 "" to be compatible with + * Internet Explorer. + * * Example: *

- * + * * *

* @@ -26,10 +29,11 @@ * @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' ); -- 2.20.1