Set locale for item, using the dirname as identifier.