Added code to save the preferred language to the user defaults.