Removing some duplication from the locale parser.