> Why do you return a string here if the only value it ever takes is an empty string?

Look at line 388. If the string is non-empty, its contents are the language.