def _get_locale_dirs(resources, include_core=True):
 contrib_dir = os.path.join(os.getcwd(), 'django', 'contrib')
 dirs = []
 for contrib_name in os.listdir(contrib_dir):
  path = os.path.join(contrib_dir, contrib_name, 'locale')
  if os.path.isdir(path):
   dirs.append((contrib_name, path))
   if (contrib_name in HAVE_JS):
    dirs.append((('%s-js' % contrib_name), path))
 if include_core:
  dirs.insert(0, ('core', os.path.join(os.getcwd(), 'django', 'conf', 'locale')))
 if (resources is not None):
  res_names = [d[0] for d in dirs]
  dirs = [ld for ld in dirs if (ld[0] in resources)]
  if (len(resources) > len(dirs)):
   print ('You have specified some unknown resources. Available resource names are: %s' % (', '.join(res_names),))
   exit(1)
 return dirs

def _get_locale_dirs ( resources , include_core = True ) : contrib_dir = os . path . join ( os . getcwd ( ) , 'django' , 'contrib' ) dirs = [ ] for contrib_name in os . listdir ( contrib_dir ) : path = os . path . join ( contrib_dir , contrib_name , 'locale' ) if os . path . isdir ( path ) : dirs . append ( ( contrib_name , path ) ) if ( contrib_name in HAVE_JS ) : dirs . append ( ( ( '%s-js' % contrib_name ) , path ) ) if include_core : dirs . insert ( 0 , ( 'core' , os . path . join ( os . getcwd ( ) , 'django' , 'conf' , 'locale' ) ) ) if ( resources is not None ) : res_names = [ d [ 0 ] for d in dirs ] dirs = [ ld for ld in dirs if ( ld [ 0 ] in resources ) ] if ( len ( resources ) > len ( dirs ) ) : print ( 'You have specified some unknown resources. Available resource names are: %s' % ( ', ' . join ( res_names ) , ) ) exit ( 1 ) return dirs
return a tuple for all locale directories .