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

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

There is a newer version: 1.1.0
Show newest version
(function LocalizationMapCache(){
    const cache = {};

    window.localizationMapCache = new function(){
        this.getLocalizationMap = function(fileName){
            if(cache[fileName] == null){
                cache[fileName] = new LocalizationMap(fileName);
            }

            return cache[fileName];
        }
    }

    function LocalizationMap(fileName){
        let map = null;

        loadLocalization(fileName, function(localization){map = localization});

        this.getLocalization = function(key){
            return map[key] || throwException("IllegalArgument", "localization not found with key " + key);
        }
    }
})();





© 2015 - 2024 Weber Informatics LLC | Privacy Policy