improve logic for locale recipe