Correct indentation for default language.
Fix coding style for else.
Better variable names.
Apply substring on the correct value.
Sort, so 'de' is preferred over 'de_DE' when performing non-exact matching.
Have to also strtolower() on available language name. Otherwise no match.
Some tests for OC_L10N::findLanguage()
fixing PHPDoc & grammar
Merge branch 'master' into fix-language-detection
Merge pull request #5493 from owncloud/fix-language-detection

Fix HTTP language detection