Refactoring of provider._get_language.

Provided some extra docs and rewrote the function.