Right now the Joomla! app uses a rather strange method to sort and display the available languages in the language drop-down menu on the Joomla! admin login page.
In the JLanguage class an SPL iterator (RecursiveIteratorIterator) is being used to get a list of all languages files. From this list it picks the xml files and parses them in order to get the language's metadata. However, that iterator outputs the list of files in their physical order they are stored on the drive. So on different envs depending on how the languages were installed the order could be literally random.
To reproduce the issue install languages and then modify the creation/modification dates of the XML files of the languages. The languages will be "sorted" in the drop down menu based on this information.
The list of languages should be sorted based on the locale code and not based on the creation/modification date of the XML files.
Right now the list is sorted based on the creation/modification date of the XML files.
CentOS 6
Apache 2.4
PHP 5.5.17
More info will be provided if it is needed.
One way to solve the issue is to sort the two-dimensional array based on the locale code before actually returning the results and displaying them on the site. The function we're talking about here is createLanguageList:
public static function createLanguageList($actualLanguage, $basePath = JPATH_BASE, $caching = false, $installed = false)
Priority | Low | ⇒ | Medium |
Status | New | ⇒ | Confirmed |
If locale code are "en-GB", "fr-FR"..... (the name of XML files), I think simply add one line of code in ModLoginHelper would solve the issue:
ksort($languages);
Thanks all! Could you submit a pull request for it? Here's a really easy way how:
http://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests
Labels |
Added:
?
|
OK. I made the PR. Please help testing it when you have time :).
Rel_Number | ⇒ | 4690 | |
Relation Type | ⇒ | Related to |
Set to "closed" on behalf of @brianteeman by The JTracker Application at issues.joomla.org/joomla-cms/4679
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-10-17 00:19:52 |
Labels |
Added:
?
|
I can confirm this as I have seen it happen although I have been unable to replicate it