locale: Don't assume 2-letter language codes.

Some languages have 3-letter codes. So instead of splitting the output
of QLocale::name, use QLocale::language and the static
QLocale::languageToString.