joomla/joomla-cms — pull request #3096 by nonumber (2014-02-13 11:55:14+00:00)
Title: Ad default behaviour to load en-GB language first

This adds the default behaviour to load the ```en-GB``` language file first as a base fall-back.

Currently the method loads the default language as base fall-back. But when the default language is not ```en-GB``` and there is no language file for the default language, then there will be no fall-back.

This has caused many extension developers, including myself, to implement an own extra ```$lang->load()``` call for ```en-GB``` first.

With this fix/addition, that will no longer be necessary.

This PR also changes the order of the checks in the if clause, placing the most simple and common checks first. The ```!$this->debug``` was placed first, whilst most website are not in debug mode. So that check should be last.

#### Testing instructions
Set the default language to something different than en-GB. Log into the admin with a different language than en-GB and not your default language (so you need at least 3 languages installed).
Then go to any view and make sure the language string for a certain text is not available for the language you are logged in with and also not for the default language (so it should only be available in the en-GB file).

Before this PR you should see the untranslated LANGUAGE_STRING. After this PR you should see the English (en-GB) translation for that string.