Remove duplicate code for language selection.