Would ```language.split('-')[0]``` work?