All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.js.common.localization.message_code.js Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
(function MessageCode(){
    const messageCodes = {};
    
    window.MessageCode = new function(){
        this.getMessage = getMessage;
    }
    
    function getMessage(messageCode){
        return messageCodes[messageCode] || "No message found for messageCode " + messageCode;
    }
    
    eventProcessor.registerProcessor(new EventProcessor(
        function(eventType){return eventType === events.LOAD_LOCALIZATION},
        function(){
            localizationLoader.loadLocalization("message_codes", addMessageCodes)
        }
    ));
    
    function addMessageCodes(codes){
        for(let eindex in codes){
            messageCodes[eindex] = codes[eindex];
        }
        eventProcessor.processEvent(new Event(events.MESSAGE_CODES_LOADED));
    }
})();




© 2015 - 2024 Weber Informatics LLC | Privacy Policy