function getCatalog(namespace,lang) {
    var result = null;
    lang = lang || defaultLang;
    if (/[^a-z\-]/i.test(lang)) {
        throw new Error("Invalid language: "+lng)
    }

    if (resourceCache.hasOwnProperty(namespace)) {
        result = resourceCache[namespace][lang];
        if (!result) {
            var langParts = lang.split("-");
            if (langParts.length == 2) {
                result = resourceCache[namespace][langParts[0]];
            }
        }
    }
    return result;
}
Gets a message catalog.
@name catalog
@function
@memberof @node-red/util_i18n