spreadsheet/ruleJS.all.full.js
function getLangDefinition(key) {
        var i = 0, j, lang, next, split,
            get = function (k) {
                if (!languages[k] && hasModule) {
                    try {
                        require('./lang/' + k);
                    } catch (e) { }
                }
                return languages[k];
            };

        if (!key) {
            return moment.fn._lang;
        }

        if (!isArray(key)) {
            //short-circuit everything else
            lang = get(key);
            if (lang) {
                return lang;
            }
            key = [key];
        }

        //pick the language from the array
        //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
        //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
        while (i < key.length) {
            split = normalizeLanguage(key[i]).split('-');
            j = split.length;
            next = normalizeLanguage(key[i + 1]);
            next = next ? next.split('-') : null;
            while (j > 0) {
                lang = get(split.slice(0, j).join('-'));
                if (lang) {
                    return lang;
                }
                if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
                    //the next array item is better than a shallower substring of this one
                    break;
                }
                j--;
            }
            i++;
        }
        return moment.fn._lang;
    }
function getLangDefinition(key) {
        var i = 0, j, lang, next, split,
            get = function (k) {
                if (!languages[k] && hasModule) {
                    try {
                        require('./lang/' + k);
                    } catch (e) { }
                }
                return languages[k];
            };

        if (!key) {
            return moment.fn._lang;
        }

        if (!isArray(key)) {
            //short-circuit everything else
            lang = get(key);
            if (lang) {
                return lang;
            }
            key = [key];
        }

        //pick the language from the array
        //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
        //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
        while (i < key.length) {
            split = normalizeLanguage(key[i]).split('-');
            j = split.length;
            next = normalizeLanguage(key[i + 1]);
            next = next ? next.split('-') : null;
            while (j > 0) {
                lang = get(split.slice(0, j).join('-'));
                if (lang) {
                    return lang;
                }
                if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
                    //the next array item is better than a shallower substring of this one
                    break;
                }
                j--;
            }
            i++;
        }
        return moment.fn._lang;
    }
function getLangDefinition ( key ) { var i = 0 , j , lang , next , split , get = function ( k ) { if ( ! languages [ k ] && hasModule ) { try { require ( './lang/' + k ) ; } catch ( e ) { } } return languages [ k ] ; } ; if ( ! key ) { return moment . fn . _lang ; } if ( ! isArray ( key ) ) { //short-circuit everything else lang = get ( key ) ; if ( lang ) { return lang ; } key = [ key ] ; } //pick the language from the array //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root while ( i < key . length ) { split = normalizeLanguage ( key [ i ] ) . split ( '-' ) ; j = split . length ; next = normalizeLanguage ( key [ i + 1 ] ) ; next = next ? next . split ( '-' ) : null ; while ( j > 0 ) { lang = get ( split . slice ( 0 , j ) . join ( '-' ) ) ; if ( lang ) { return lang ; } if ( next && next . length >= j && compareArrays ( split , next , true ) >= j - 1 ) { //the next array item is better than a shallower substring of this one break ; } j -- ; } i ++ ; } return moment . fn . _lang ; }
Determines which language definition to use and returns it.  With no parameters, it will return the global language.  If you pass in a language key, such as 'en', it will return the definition for 'en', so long as 'en' has already been loaded using moment.lang.
Determines which language definition to use and returns it . With no parameters it will return the global language . If you pass in a language key such as en it will return the definition for en so long as en has already been loaded using moment . lang .