def to_locale(language):
    p = language.find('-')
    if p >= 0:
        return language[:p].lower()+'_'+language[p+1:].upper()
    else:
        return language.lower()
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/utils/translation/trans_null.py/to_locale/original