def normalize_locale(loc):
 return loc.lower().replace('_', '-')

def normalize_locale ( loc ) : return loc . lower ( ) . replace ( '_' , '-' )
format a locale specifier according to the format returned by locale -a .