Add function to get the language of the current input source/keyboard layout
@dankor
Submitted by Daniel Korostil Link to original bug (#771669)
Description
Currently the default language is taken from the locale, not from the input source. If you have your desktop in English, then the default language will be English.
But in a program like GNOME Software, the language is not saved, it always takes the default language from the locale (that’s what GtkSpell also do). So for those applications, yes it can make sense to take the language from the input source/keyboard layout.
Also it's useful for Polari (having rooms in different languages), Evolution (respond massages in different languages), etc.