I'd move when locale is defined to just before where _make_mail is called.