var Bind = require("github/jillix/bind");
var Events = require("github/jillix/events");

module.exports = function(config) {

    var self = this;
    Events.call(self, config);

    self.translate  = function (messageToTranslate, callback) {

        // if the message to translate is a valid json format string,
        // convert it into an object
        try {
            messageToTranslate = JSON.parse(messageToTranslate);
        } catch (e) {}

        // set default value for translations
        config.translations = config.translations || {};

        // received message
        var message;

        // if messageToTranlsate is an object, received message is
        // message key value from messageToTranslate
        if (messageToTranslate instanceof Object && messageToTranslate.message) {
            message = messageToTranslate.message;
        }

        // if messageToTranlsate is a string, received message is
        // messageToTranlsate. messageToTranlsate is converted into
        // an object
        if (typeof messageToTranslate === "string") {
            message = messageToTranslate;
            messageToTranslate = {};
        }

        // no message, throw error
        if (!message) { return console.error("The message is not in the i18n format."); }

        // overwrite the message with its translation
        var message = config.translations[message] || message;

        if (message instanceof Object) {
            message = message[config.lang || M.getLocale()];
        }

        // callback the translation
        messageToTranslate.message = message;
        callback(null, messageToTranslate);
    };

    // listen to crud events
    if (config.translates instanceof Array) {
        for (var i = 0; i < config.translates.length; ++i) {
            self.on("message", config.translates[i], self.translate);
        }
    }


    self.emit("ready", config);
};

@@ -1665,76 +1665,328 @@
  // 
-listen to crud events%0A
+dinamically add a new miid to listen%0A    self.listenTo = function (listen) %7B%0A%0A        // force listen to be an array%0A 
     
+   
 if (
-config.translates instanceof Array) %7B%0A
+typeof listen === %22string%22) %7B%0A            listen = %5Blisten%5D;%0A        %7D%0A%0A        // listen to crud events%0A        if (listen instanceof Array) %7B%0A            // every listen miid to listen%0A    
     
@@ -2009,33 +2009,22 @@
  0; i %3C 
-config.translates
+listen
 .length;
@@ -2027,24 +2027,66 @@
 gth; ++i) %7B%0A
+                // add message listen%0A    
             
@@ -2108,25 +2108,14 @@
 e%22, 
-config.translates
+listen
 %5Bi%5D,
@@ -2144,17 +2144,191 @@
     
+    
 %7D%0A    
-%7D%0A%0A
+        return;%0A        %7D%0A%0A        console.error(%22Invalid type of listen parameter.%22);%0A    %7D;%0A%0A    // call listen to%0A    self.listenTo(config.translates);%0A%0A    // emit ready
 %0A   

Add a new miid that i18n will lisen to.