This is not an issue. Rather it is a suggestion for improvement.
At present the Language Selection in Joomla Installer displays only the nativeName in the list. This makes language names to display in different places not alphabetically by [English] name. This is true especially for language names that do not contain Latin characters. For example, Spanish would appear immediately after English as the native name for Spanish is Español. You can also notice other language such as Tamil (with native name தமிழ்)is listed after the English alphabet names.
Suggestion is to show the language name (ie English Name) along with native name in the list and the list sorted in the language name. This would help to see the languages alphabetically in English. In addition, it would help to find the language easily.
Notice the language names sorted alphabetically in English along with their native name.
Notice the language names sorted alphabetically by their native name.
Joomla! 4
To test the implementation, I have modified two files as shown below:
(a) File: \installation\src\Form\Field\Installation\LanguageField.php
Original code:
// Get the list of available languages.
$options = LanguageHelper::createLanguageList($native);
Modified code:
// Get the list of available languages.
$options = LanguageHelper::createLanguageListInstall($native);
(b) File: \libraries\src\Language\LanguageHelper.php
New Code:
public static function createLanguageListInstall($actualLanguage, $basePath = JPATH_BASE, $caching = false, $installed = false)
{
$list = array();
$clientId = $basePath === JPATH_ADMINISTRATOR ? 1 : 0;
$languages = $installed ? static::getInstalledLanguages($clientId, true) : self::getKnownLanguages($basePath);
foreach ($languages as $languageCode => $language)
{
$metadata = $installed ? $language->metadata : $language;
$list[] = array(
'text' => $metadata['name'] . " | " . $metadata['nativeName'] ?? $metadata['name'],
'value' => $languageCode,
'selected' => $languageCode === $actualLanguage ? 'selected="selected"' : null,
);
}
return $list;
}
Note:
(i) For the new function, I just mimicked the existing function createLanguageList ()
(ii) Probably this could be implemented more efficiently
(iii) Of course, languages' [English] names have to be standardized in the languages' xml files where needed
(iv) This could be implemented in Joomla! 3, if desired
I raised this a long long time ago so I 10000% agree
And you pr got rejected? If you create a pr I would support it.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-08-23 18:33:44 |
Closed_By | ⇒ | zero-24 | |
Labels |
Removed:
?
|
Cloding here as there is a PR thanks Brian
I raised this a long long time ago so I 10000% agree