Index: trunk/phase3/resources/jquery/jquery.localize.js |
— | — | @@ -6,9 +6,12 @@ |
7 | 7 | * with localized text, elements with title-msg and alt-msg attributes will receive localized title |
8 | 8 | * and alt attributes. |
9 | 9 | * |
| 10 | + * Note that "msg" elements must have html namespacing such as "<html:msg />" to be compatible with |
| 11 | + * Internet Explorer. |
| 12 | + * |
10 | 13 | * Example: |
11 | 14 | * <p class="somethingCool"> |
12 | | - * <msg key="my-message" /> |
| 15 | + * <html:msg key="my-message" /> |
13 | 16 | * <img src="something.jpg" title-msg="my-title-message" alt-msg="my-alt-message" /> |
14 | 17 | * </p> |
15 | 18 | * |
— | — | @@ -26,10 +29,11 @@ |
27 | 30 | * @param Object: options Map of options |
28 | 31 | * * prefix: Message prefix to use when localizing elements and attributes |
29 | 32 | */ |
| 33 | + |
30 | 34 | $.fn.localize = function( options ) { |
31 | 35 | options = $.extend( { 'prefix': '' }, options ); |
32 | 36 | return $(this) |
33 | | - .find( 'msg' ) |
| 37 | + .find( 'msg,html\\:msg' ) |
34 | 38 | .each( function() { |
35 | 39 | $(this) |
36 | 40 | .text( mediaWiki.msg( options.prefix + $(this).attr( 'key' ) ) ) |
— | — | @@ -50,4 +54,7 @@ |
51 | 55 | .removeAttr( 'alt-msg' ); |
52 | 56 | } ) |
53 | 57 | .end(); |
54 | | -}; |
\ No newline at end of file |
| 58 | +}; |
| 59 | + |
| 60 | +// Let IE know about the msg tag before it's used... |
| 61 | +document.createElement( 'msg' ); |