X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=resources%2Fsrc%2Fjquery%2Fjquery.localize.js;h=20dc1b20fefb440a0b5f16d170e77a3f1857cb4e;hp=b1bf0f48ae36e3933ff45535b95cb9fcef06048d;hb=44e0eec66d1ae04544f3a61884e93321fcb0d9df;hpb=732b5e2745ca8f6153e19cc10c3c9acb1b2a6331 diff --git a/resources/src/jquery/jquery.localize.js b/resources/src/jquery/jquery.localize.js index b1bf0f48ae..20dc1b20fe 100644 --- a/resources/src/jquery/jquery.localize.js +++ b/resources/src/jquery/jquery.localize.js @@ -29,6 +29,7 @@ * with attributes that do not have the "-msg" suffix and contain a localized message. * * Example: + * * // Messages: { 'title': 'Awesome', 'desc': 'Cat doing backflip' 'search' contains 'Search' } * var html = '\ *

\ @@ -39,6 +40,7 @@ * $( 'body' ).append( $( html ).localize() ); * * Appends something like this to the body... + * *

* Awesome * Cat doing backflip @@ -52,17 +54,20 @@ * of a message in the same selection being localized - they will all recieve the same parameters. * * Example: + * * // Messages: { 'easy-as': 'Easy as $1 $2 $3.' } * var html = '

'; * $( 'body' ).append( $( html ).localize( { 'params': { 'easy-as': ['a', 'b', 'c'] } } ) ); * * Appends something like this to the body... + * *

Easy as a, b, c

* * Raw HTML content can be used, instead of it being escaped as text. To do this, just use the raw * attribute on a msg element. * * Example: + * * // Messages: { 'hello': 'Hello $1!' } * var html = '\ *

\ @@ -72,6 +77,7 @@ * $( 'body' ).append( $( html ).localize( { 'params': { 'hello': ['world'] } } ) ); * * Appends something like this to the body... + * *

* <b><i>Hello</i> world!</b> * Hello world! @@ -81,22 +87,26 @@ * of messages. This is important for improving re-usability of templates. * * Example: + * * // Messages: { 'good-afternoon': 'Good afternoon' } * var html = '

'; * $( 'body' ).append( $( html ).localize( { 'keys': { 'greeting': 'good-afternoon' } } ) ); * * Appends something like this to the body... + * *

Good afternoon

* * Message keys can also be prefixed globally, which is handy when writing extensions, where by * convention all messages are prefixed with the extension's name. * * Example: + * * // Messages: { 'teleportation-warning': 'You may not get there all in one piece.' } * var html = '

'; * $( 'body' ).append( $( html ).localize( { 'prefix': 'teleportation-' } ) ); * * Appends something like this to the body... + * *

You may not get there all in one piece.

* * @param {Object} options Map of options to be used while localizing