Fixed language path for languages with non-URI chars

This PR fixes issue #2070: Incorrect links for languages with non-URI characters. I'm not a Ruby developer, so I'm not sure if I have structured the code correctly.