* 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' ) ) )
.removeAttr( 'alt-msg' );
} )
.end();
-};
\ No newline at end of file
+};
+
+// Let IE know about the msg tag before it's used...
+document.createElement( 'msg' );