Added a method to localize attributes.