index.js
function find(search, filter, strict) {
  var lang, search = search || [], i, k, v, re = /^(LC_|LANG)/;
  for(i = 0;i < search.length;i++) {
    lang = sanitize(process.env[search[i]] || '', filter);
    if(lang) return c(lang);
  }
  // nothing found in search array, find first available
  for(k in process.env) {
    v = process.env[k];
    if(re.test(k) && v) {
      lang = sanitize(v, filter);
      if(lang) break;
    }
  }
  if(!lang) lang = c(sanitize(process.env.LANG, filter));
  return c(lang) || (!strict ? language : null);
}
function find(search, filter, strict) {
  var lang, search = search || [], i, k, v, re = /^(LC_|LANG)/;
  for(i = 0;i < search.length;i++) {
    lang = sanitize(process.env[search[i]] || '', filter);
    if(lang) return c(lang);
  }
  // nothing found in search array, find first available
  for(k in process.env) {
    v = process.env[k];
    if(re.test(k) && v) {
      lang = sanitize(v, filter);
      if(lang) break;
    }
  }
  if(!lang) lang = c(sanitize(process.env.LANG, filter));
  return c(lang) || (!strict ? language : null);
}
function find ( search , filter , strict ) { var lang , search = search || [ ] , i , k , v , re = / ^(LC_|LANG) / ; for ( i = 0 ; i < search . length ; i ++ ) { lang = sanitize ( process . env [ search [ i ] ] || '' , filter ) ; if ( lang ) return c ( lang ) ; } // nothing found in search array, find first available for ( k in process . env ) { v = process . env [ k ] ; if ( re . test ( k ) && v ) { lang = sanitize ( v , filter ) ; if ( lang ) break ; } } if ( ! lang ) lang = c ( sanitize ( process . env . LANG , filter ) ) ; return c ( lang ) || ( ! strict ? language : null ) ; }
Find the value of an LC environment variable and return a
sanitized represention of the locale.

If no variable value is found in the search array then this
method returns the first available LC variable.

@param search An array of LC variables to prefer.
@param filter A filter function.
@param strict A boolean indicating that the default language
should never be returned.

@return A language identifier.
Find the value of an LC environment variable and return a sanitized represention of the locale .