Fixed #18419 -- Full backwards compatibility for old language codes

Thanks to Baptiste Mispelon for the code reviews.