Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- steal("en.json", "messageformat.js", function( translation ) {
- var mf = new MessageFormat("en"),
- cache = {};
- // Add EJS helper
- can.extend( can.EJS.Helpers.prototype, {
- message : function( key, data ) {
- if ( ! cache[ key ] ) {
- cache[ key ] = mf.compile( translation[ key ] || "ERROR: <" + key + "> NOT DEFINED" );
- }
- return cache[ key ].call( this, data || {} );
- }
- });
- });
Add Comment
Please, Sign In to add comment