Merge "Avoid exceptions by first checking language code validity"