From: Andrew Garrett Date: Mon, 13 Feb 2012 22:39:15 +0000 (+0000) Subject: Modification to jquery.localize.js: For HTML elements, allow a raw="" parameter,... X-Git-Tag: 1.31.0-rc.0~24721 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=c32132b9bb73d21494df3f718741f04aad7c867b;p=lhc%2Fweb%2Fwiklou.git Modification to jquery.localize.js: For HTML elements, allow a raw="" parameter, which prevents escaping. Reviewed by Trevor before I committed it. --- diff --git a/resources/jquery/jquery.localize.js b/resources/jquery/jquery.localize.js index 3a7925bf53..42554e0b76 100644 --- a/resources/jquery/jquery.localize.js +++ b/resources/jquery/jquery.localize.js @@ -45,8 +45,15 @@ $.fn.localize = function( options ) { .find( 'msg,html\\:msg' ) .each( function() { var $el = $(this); + var msgText = msg( $el.attr( 'key' ) ); + + if ( $el.attr('raw') ) { + $el.html(msgText); + } else { + $el.text(msgText); + } + $el - .text( msg( $el.attr( 'key' ) ) ) .replaceWith( $el.html() ); } ) .end()