def to_language(locale):
    p = locale.find('_')
    if p >= 0:
        return locale[:p].lower()+'-'+locale[p+1:].lower()
    else:
        return locale.lower()
Turns a locale name (en_US) into a language name (en-us).
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/utils/translation/trans_real.py/to_language